2022-02-27 20:57:30 +00:00
|
|
|
using System.Collections.Immutable;
|
|
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
|
|
|
|
namespace Godot.SourceGenerators
|
|
|
|
{
|
2022-07-07 15:58:13 +00:00
|
|
|
public readonly struct GodotMethodData
|
2022-02-27 20:57:30 +00:00
|
|
|
{
|
|
|
|
public GodotMethodData(IMethodSymbol method, ImmutableArray<MarshalType> paramTypes,
|
2022-02-27 20:57:46 +00:00
|
|
|
ImmutableArray<ITypeSymbol> paramTypeSymbols, MarshalType? retType, ITypeSymbol? retSymbol)
|
2022-02-27 20:57:30 +00:00
|
|
|
{
|
|
|
|
Method = method;
|
|
|
|
ParamTypes = paramTypes;
|
|
|
|
ParamTypeSymbols = paramTypeSymbols;
|
|
|
|
RetType = retType;
|
2022-02-27 20:57:46 +00:00
|
|
|
RetSymbol = retSymbol;
|
2022-02-27 20:57:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public IMethodSymbol Method { get; }
|
|
|
|
public ImmutableArray<MarshalType> ParamTypes { get; }
|
|
|
|
public ImmutableArray<ITypeSymbol> ParamTypeSymbols { get; }
|
|
|
|
public MarshalType? RetType { get; }
|
2022-02-27 20:57:46 +00:00
|
|
|
public ITypeSymbol? RetSymbol { get; }
|
2022-02-27 20:57:30 +00:00
|
|
|
}
|
|
|
|
|
2022-07-07 15:58:13 +00:00
|
|
|
public readonly struct GodotSignalDelegateData
|
2022-07-28 15:41:47 +00:00
|
|
|
{
|
|
|
|
public GodotSignalDelegateData(string name, INamedTypeSymbol delegateSymbol, GodotMethodData invokeMethodData)
|
|
|
|
{
|
|
|
|
Name = name;
|
|
|
|
DelegateSymbol = delegateSymbol;
|
|
|
|
InvokeMethodData = invokeMethodData;
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Name { get; }
|
|
|
|
public INamedTypeSymbol DelegateSymbol { get; }
|
|
|
|
public GodotMethodData InvokeMethodData { get; }
|
|
|
|
}
|
|
|
|
|
2022-07-07 15:58:13 +00:00
|
|
|
public readonly struct GodotPropertyData
|
2022-02-27 20:57:30 +00:00
|
|
|
{
|
|
|
|
public GodotPropertyData(IPropertySymbol propertySymbol, MarshalType type)
|
|
|
|
{
|
|
|
|
PropertySymbol = propertySymbol;
|
|
|
|
Type = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IPropertySymbol PropertySymbol { get; }
|
|
|
|
public MarshalType Type { get; }
|
|
|
|
}
|
|
|
|
|
2022-07-07 15:58:13 +00:00
|
|
|
public readonly struct GodotFieldData
|
2022-02-27 20:57:30 +00:00
|
|
|
{
|
|
|
|
public GodotFieldData(IFieldSymbol fieldSymbol, MarshalType type)
|
|
|
|
{
|
|
|
|
FieldSymbol = fieldSymbol;
|
|
|
|
Type = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IFieldSymbol FieldSymbol { get; }
|
|
|
|
public MarshalType Type { get; }
|
|
|
|
}
|
2022-08-15 08:53:08 +00:00
|
|
|
|
|
|
|
public struct GodotPropertyOrFieldData
|
|
|
|
{
|
|
|
|
public GodotPropertyOrFieldData(ISymbol symbol, MarshalType type)
|
|
|
|
{
|
|
|
|
Symbol = symbol;
|
|
|
|
Type = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public GodotPropertyOrFieldData(GodotPropertyData propertyData)
|
|
|
|
: this(propertyData.PropertySymbol, propertyData.Type)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public GodotPropertyOrFieldData(GodotFieldData fieldData)
|
|
|
|
: this(fieldData.FieldSymbol, fieldData.Type)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public ISymbol Symbol { get; }
|
|
|
|
public MarshalType Type { get; }
|
|
|
|
}
|
2022-02-27 20:57:30 +00:00
|
|
|
}
|