|
| 1 | +using FFXIVClientStructs.FFXIV.Component.Excel; |
| 2 | + |
1 | 3 | namespace FFXIVClientStructs.FFXIV.Common.Component.Excel; |
2 | 4 |
|
3 | 5 | // Common::Component::Excel::ExcelSheet |
4 | 6 | // Common::Component::Excel::LinkList<Common::Component::Excel::ExcelSheet> |
| 7 | +[GenerateInterop] |
5 | 8 | [StructLayout(LayoutKind.Explicit, Size = 0x100)] |
6 | | -public unsafe struct ExcelSheet { |
| 9 | +public unsafe partial struct ExcelSheet { |
7 | 10 | [FieldOffset(0x00), CExporterBaseType] public LinkList<ExcelSheet> Base; |
8 | 11 | [FieldOffset(0x18)] public ExcelLanguage Language; |
9 | 12 | [FieldOffset(0x20)] public CStringPointer SheetName; // 32 Bytes |
10 | 13 | [FieldOffset(0x30)] public uint RowCount; |
11 | 14 | [FieldOffset(0x38)] public ColumnInfo* ColumnDefinitions; |
12 | 15 | [FieldOffset(0x40)] public uint DataOffset; |
13 | | - //[FieldOffset(0x44)] public uint DataOffset2; |
| 16 | + [FieldOffset(0x44)] public uint RowLength; // in bytes |
14 | 17 |
|
15 | 18 | //[FieldOffset(0x70)] public LinkList<ExcelPage> ExcelPages; |
| 19 | + // 0x88 LinkList for subrows? |
| 20 | + |
| 21 | + [FieldOffset(0xA8)] private uint CachedAllocatedRowCount; // not sure how it's cached yet. use the function which falls back to calling the function on RowResolver |
16 | 22 |
|
17 | | - //[FieldOffset(0xB0)] public IExcelPageRowResolver* RowResolver; |
| 23 | + [FieldOffset(0xB0)] public IExcelPageRowResolver* RowResolver; |
18 | 24 |
|
19 | 25 | [FieldOffset(0xD0)] public ExcelVariant Variant; |
20 | 26 | [FieldOffset(0xD4)] public ushort ColumnCount; |
| 27 | + [FieldOffset(0xD6)] public short StartColumn; // initialized with -1. then, if -1, set to the current index in a loop over ColumnDefinitions. so technically always 0 unless there are no columns |
21 | 28 |
|
22 | | - [FieldOffset(0xD8)] public ushort Version; //? |
| 29 | + [FieldOffset(0xD8)] public ushort Version; |
23 | 30 | [FieldOffset(0xDA)] public ushort SheetIndex; |
24 | 31 |
|
| 32 | + [FieldOffset(0xF8)] public uint WaiterCount; |
| 33 | + |
| 34 | + [MemberFunction("E8 ?? ?? ?? ?? 8B D0 BD")] |
| 35 | + public partial uint GetAllocatedRowCount(); |
| 36 | + |
| 37 | + [MemberFunction("E8 ?? ?? ?? ?? 48 8B 4F ?? 49 89 44 0E")] |
| 38 | + public partial IExcelRowWrapper* GetRowByDescriptor(ExcelRowDescriptor* descriptor, uint* outErrorCode = null); |
| 39 | + |
| 40 | + [MemberFunction("E8 ?? ?? ?? ?? 8B D3 48 8B F8")] |
| 41 | + public partial IExcelRowWrapper* GetRowById(uint rowId, uint* outErrorCode = null); |
| 42 | + |
25 | 43 | public Span<ColumnInfo> ColumnDefinitionSpan => new(ColumnDefinitions, ColumnCount); |
26 | 44 |
|
27 | | - [StructLayout(LayoutKind.Sequential, Pack = 1)] |
| 45 | + [StructLayout(LayoutKind.Explicit, Size = 0x06)] |
28 | 46 | public struct ColumnInfo { |
29 | | - public ushort Type; |
30 | | - public ushort Index; |
31 | | - public ushort Offset; |
| 47 | + [FieldOffset(0x00), CExporterIgnore] private ExcelColumnType ColumnType; |
| 48 | + [FieldOffset(0x00)] public ushort Type; // TODO: use ExcelColumnType |
| 49 | + [FieldOffset(0x02)] public ushort Index; |
| 50 | + [FieldOffset(0x04)] public ushort Offset; |
32 | 51 | } |
33 | 52 | } |
0 commit comments