2023-08-14 22:25:37 +02:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2019-03-29 00:39:10 +02:00
|
|
|
|
|
|
|
|
|
|
namespace HarfBuzzSharp
|
2019-01-20 17:59:57 +01:00
|
|
|
|
{
|
2019-07-21 21:15:59 +02:00
|
|
|
|
public partial struct Script : IEquatable<Script>
|
2019-01-20 17:59:57 +01:00
|
|
|
|
{
|
2019-03-29 00:39:10 +02:00
|
|
|
|
private readonly Tag tag;
|
2019-01-20 17:59:57 +01:00
|
|
|
|
|
2019-02-05 16:32:49 +01:00
|
|
|
|
private Script (Tag tag)
|
2019-01-31 09:50:00 +01:00
|
|
|
|
{
|
2019-03-29 00:39:10 +02:00
|
|
|
|
this.tag = tag;
|
2019-01-31 09:50:00 +01:00
|
|
|
|
}
|
2019-01-20 17:59:57 +01:00
|
|
|
|
|
2019-03-29 00:39:10 +02:00
|
|
|
|
public Direction HorizontalDirection =>
|
|
|
|
|
|
HarfBuzzApi.hb_script_get_horizontal_direction (tag);
|
2019-03-14 10:55:03 +01:00
|
|
|
|
|
2019-06-18 16:33:10 +02:00
|
|
|
|
public static Script Parse (string str) =>
|
2019-07-21 21:15:59 +02:00
|
|
|
|
HarfBuzzApi.hb_script_from_string (str, -1);
|
2019-01-31 09:50:00 +01:00
|
|
|
|
|
2019-10-24 20:57:48 +02:00
|
|
|
|
public static bool TryParse (string str, out Script script)
|
|
|
|
|
|
{
|
|
|
|
|
|
script = Parse (str);
|
|
|
|
|
|
|
|
|
|
|
|
return script != Unknown;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-03-29 00:39:10 +02:00
|
|
|
|
public override string ToString () => tag.ToString ();
|
2019-01-31 09:50:00 +01:00
|
|
|
|
|
2019-03-29 00:39:10 +02:00
|
|
|
|
public static implicit operator uint (Script script) => script.tag;
|
2019-01-31 09:50:00 +01:00
|
|
|
|
|
|
|
|
|
|
public static implicit operator Script (uint tag) => new Script (tag);
|
2019-03-14 10:55:03 +01:00
|
|
|
|
|
2019-03-29 00:39:10 +02:00
|
|
|
|
public override bool Equals (object obj) =>
|
2019-10-24 20:57:48 +02:00
|
|
|
|
obj is Script script && tag.Equals (script.tag);
|
2019-03-14 10:55:03 +01:00
|
|
|
|
|
2019-03-29 00:39:10 +02:00
|
|
|
|
public bool Equals (Script other) => tag.Equals (other.tag);
|
2019-03-14 10:55:03 +01:00
|
|
|
|
|
2019-03-29 00:39:10 +02:00
|
|
|
|
public override int GetHashCode () => tag.GetHashCode ();
|
2019-01-20 17:59:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|