Simplified bindings generation

This commit is contained in:
Stowy 2024-12-22 18:20:31 +01:00
parent 4699018599
commit eb1ee390bb
4 changed files with 383 additions and 393 deletions

View File

@ -2,6 +2,11 @@ AT_COMPILE_TIME :: true;
SOURCE_PATH :: "source";
DECLARATIONS_TO_OMIT :: string.[
"Clay_Vector2",
"Clay_Color",
];
#if AT_COMPILE_TIME {
#run,stallable {
Compiler.set_build_options_dc(.{do_output=false});
@ -22,389 +27,32 @@ SOURCE_PATH :: "source";
}
}
Build_Type :: enum {
STATIC_LIBRARY;
DYNAMIC_LIBRARY;
EXECUTABLE;
OBJ_FILE;
}
build_cpp_static_lib :: #bake_arguments build_cpp(type = .STATIC_LIBRARY);
build_cpp_dynamic_lib :: #bake_arguments build_cpp(type = .DYNAMIC_LIBRARY);
build_cpp_executable :: #bake_arguments build_cpp(type = .EXECUTABLE);
// This is a modified version of the procedure from BuildCpp. It will assume a clang-like compiler if you add something to compiler_executable_path.
build_cpp :: (
output_basename: string,
files: ..string,
type: Build_Type,
debug := false,
extra: [] string = .[],
library_files: [] string = .[],
target := OS,
compiler_executable_path := "",
ar_executable_path := "",
working_directory := "",
loc := #caller_location
) -> bool {
Basic.auto_release_temp();
Basic.push_allocator(Basic.temp);
arguments: [..] string;
output_filename: string;
if target == .WINDOWS && compiler_executable_path == "" {
if #complete type == {
case .STATIC_LIBRARY;
output_filename = Basic.tprint("%.lib", output_basename);
case .DYNAMIC_LIBRARY;
output_filename = Basic.tprint("%.dll", output_basename);
case .EXECUTABLE;
output_filename = Basic.tprint("%.exe", output_basename);
case .OBJ_FILE;
output_filename = Basic.tprint("%.obj", output_basename);
}
#if OS == .WINDOWS {
String.path_overwrite_separators(output_filename, #char "\\");
vc_path, linker_path := WindowsResources.find_visual_studio_in_a_ridiculous_garbage_way();
kit_root := WindowsResources.find_windows_kit_root();
if !kit_root {
Compiler.compiler_report("Unable to find Windows Kit root; can't compile.\n", loc);
return false;
}
} else {
Compiler.compiler_report("Unable to find Visual Studio; can't compile.\n", loc);
vc_path, linker_path: string;
kit_root: string;
return false; // Visual studio is not available in non-windows OS.
}
linker := String.join(linker_path, "\\", "cl.exe");
Basic.array_add(*arguments, linker);
Basic.array_add(*arguments, "/nologo");
// Include directories:
vc_include_path := String.join(vc_path, "\\..\\..\\include");
kit_root_include := String.replace(kit_root, "Lib", "Include");
Basic.array_add(*arguments,
Basic.tprint("/I%", vc_include_path),
Basic.tprint("/I%\\um", kit_root_include),
Basic.tprint("/I%\\ucrt", kit_root_include),
Basic.tprint("/I%\\shared", kit_root_include),
);
// Definitions:
Basic.array_add(*arguments, "/DWIN32");
if debug {
Basic.array_add(*arguments, "/DDEBUG");
}
// Compiler options:
if debug {
Basic.array_add(*arguments, "/Od"); // Disable optimizations.
} else {
Basic.array_add(*arguments,
"/O2", // Maximize speed.
"/Oi", // Enable intrinsics.
);
}
Basic.array_add(*arguments, "/W3");
if debug {
Basic.array_add(*arguments,
"/DEBUG", // Generate debug info.
"/Zi", // Generate pdb file.
Basic.tprint("/Fd%.pdb", output_basename), // Sets name of pdb file.
);
}
Basic.array_add(*arguments,
"-diagnostics:caret",
"-diagnostics:column"
);
Basic.array_add(*arguments, .. extra);
// Add files:
objs: [..] string;
Basic.array_reserve(*objs, files.count);
for files {
src := String.copy_temporary_string(it);
String.path_overwrite_separators(src);
Basic.array_add(*arguments, src);
Basic.array_add(*objs, Basic.tprint("%.obj", String.path_strip_extension(String.path_filename(it))));
}
// Make sure to cleanup the resulting obj files.
defer {
if type != .OBJ_FILE {
for objs File.file_delete(it);
}
if type == .DYNAMIC_LIBRARY then File.file_delete(Basic.tprint("%.exp", output_basename));
}
if type == .STATIC_LIBRARY || type == .OBJ_FILE {
Basic.array_add(*arguments, "/c"); // Compile without linking.
} else {
Basic.array_add(*arguments, "/link");
// Linker options:
if type == .DYNAMIC_LIBRARY {
Basic.array_add(*arguments, "/DLL");
}
Basic.array_add(*arguments,
"/MACHINE:AMD64",
Basic.tprint("/OUT:%", output_filename),
Basic.tprint("/libpath:%", vc_path),
Basic.tprint("/libpath:%\\um\\x64", kit_root),
Basic.tprint("/libpath:%\\ucrt\\x64", kit_root),
);
}
Basic.array_add(*arguments, .. library_files);
Basic.log("%", Process.get_quoted_command_string(arguments));
result, output_string, error_string := Process.run_command(..arguments, capture_and_return_output = true, print_captured_output = true, working_directory = working_directory);
if result.exit_code {
Compiler.compiler_report(Basic.tprint("Compiler failed with exit code '%'.\n", result.exit_code), loc);
return false;
}
if type == .STATIC_LIBRARY {
// Create library:
Basic.array_reset_keeping_memory(*arguments);
librarian := String.join(linker_path, "\\lib.exe");
Basic.array_add(*arguments, librarian, "/nologo");
Basic.array_add(*arguments, ..objs);
Basic.array_add(*arguments, Basic.tprint("/OUT:%", output_filename));
Basic.log("%", Process.get_quoted_command_string(arguments));
result, output_string, error_string := Process.run_command(..arguments, capture_and_return_output = true, print_captured_output = true, working_directory = working_directory);
if result.exit_code {
Compiler.compiler_report(Basic.tprint("Librarian failed with exit code '%'.\n", result.exit_code), loc);
return false;
}
}
} else {
if #complete type == {
case .STATIC_LIBRARY;
#if OS == .WINDOWS {
output_filename = Basic.tprint("%.lib", output_basename);
} else {
output_filename = Basic.tprint("%.a", output_basename);
}
case .OBJ_FILE;
output_filename = Basic.tprint("%.o", output_basename);
case .DYNAMIC_LIBRARY;
if target == {
case .WINDOWS; output_filename = Basic.tprint("%.dll", output_basename);
case .MACOS; output_filename = Basic.tprint("%.dylib", output_basename);
case .LINUX; #through;
case .ANDROID; output_filename = Basic.tprint("%.so", output_basename);
case .NONE; #if OS == .WINDOWS then output_filename = Basic.tprint("%.dll", output_basename); else assert(false);
case; assert(false);
}
case .EXECUTABLE;
output_filename = Basic.copy_temporary_string(output_basename);
}
#if OS == .WINDOWS {
String.path_overwrite_separators(output_filename, #char "\\");
}
compiler := compiler_executable_path;
ar := ar_executable_path;
if !compiler || (type == .STATIC_LIBRARY && !ar) {
is_cpp_project := false;
for files {
if String.ends_with(it, ".cpp") {
is_cpp_project = true; // Use c++ compiler, so we link the required c++ runtime libraries by default.
break;
}
}
if !compiler {
if is_cpp_project {
// @Cleanup: Could be simplified to the following, but that currently triggers a compiler bug. -rluba, 2024-01-23
// compiler = ifx to_string(getenv("CXX")) else "clang++";
compiler = to_string(getenv("CXX"));
if !compiler compiler ="clang++";
} else {
compiler = to_string(getenv("CC"));
if !compiler compiler ="clang";
}
}
if !ar ar = "ar";
}
Basic.array_add(*arguments, compiler);
if debug {
Basic.array_add(*arguments, "-g", "-Og");
} else {
Basic.array_add(*arguments, "-O3");
}
Basic.array_add(*arguments, ..extra);
if type == .STATIC_LIBRARY || type == .OBJ_FILE {
array_add(*arguments, "-c");
} else {
if type == .DYNAMIC_LIBRARY {
array_add(*arguments, "-shared", "-fpic");
}
if target == .MACOS {
if type == {
case .DYNAMIC_LIBRARY;
array_add(*arguments, "-install_name", tprint("@rpath/%", output_filename));
case .EXECUTABLE;
array_add(*arguments, "-rpath", "@loader_path");
}
}
array_add(*arguments, "-o", output_filename);
}
// Add files:
objs: [..] string;
array_reserve(*objs, files.count);
for files {
src := copy_temporary_string(it);
String.path_overwrite_separators(src);
array_add(*arguments, src);
array_add(*objs, tprint("%.o", String.path_basename(it)));
}
// Make sure to cleanup the resulting obj files.
defer {
if type != .OBJ_FILE {
for objs File.file_delete(it);
}
}
array_add(*arguments, .. library_files);
log("%", Process.get_quoted_command_string(arguments));
result, output_string, error_string := Process.run_command(..arguments, capture_and_return_output = true, print_captured_output = true, working_directory = working_directory);
if result.exit_code {
Compiler.compiler_report(tprint("Compiler failed with exit code '%'.\n", result.exit_code), loc);
return false;
}
if type == .STATIC_LIBRARY {
File.file_delete(output_filename); // ar only adds/updates the archive, but does not delete files from it.
// Create library:
array_reset_keeping_memory(*arguments);
array_add(*arguments,
ar,
"-rc", // replace or insert files into the archive, do not warn if archive needs to be created.
output_filename,
);
array_add(*arguments, ..objs);
// Run archiver command:
log("%", Process.get_quoted_command_string(arguments));
result, output_string, error_string := Process.run_command(..arguments, capture_and_return_output = true, print_captured_output = true, working_directory = working_directory);
if result.exit_code {
Compiler.compiler_report(tprint("Archive command failed with exit code '%'.\n", result.exit_code), loc);
return false;
}
}
}
return true;
}
enum_cpp_files :: (path: string, recursive:=false) -> [..] string {
files: [..] string;
visitor :: (info: *FileUtils.File_Visit_Info, files: *[..] string) {
extension := String.path_extension(info.full_name);
if extension == "cpp" || extension == "c" {
Basic.array_add(files, String.copy_string(info.full_name));
}
}
FileUtils.visit_files(path, recursive=recursive, *files, visitor);
return files;
}
free_cpp_files :: (files: [] string) {
for files Basic.free(it);
Basic.array_free(files);
}
generate_bindings :: (args: [] string, minimum_os_version: type_of(Compiler.Build_Options.minimum_os_version)) -> bool {
compile := Basic.array_find(args, "-compile");
compile_debug := Basic.array_find(args, "-debug");
compile := array_find(args, "-compile");
compile_debug := array_find(args, "-debug");
if compile {
could_copy := FileUtils.copy_file("../../clay.h", "source/clay.h");
if !could_copy then return false;
source_file := Basic.tprint("%/clay.c", SOURCE_PATH);
source_file := tprint("%/clay.c", SOURCE_PATH);
success := true;
#if OS == .WINDOWS {
File.make_directory_if_it_does_not_exist("clay-jai/windows", true);
// Can't use this because clay doesn't support MSVC
success &&= build_cpp_static_lib(
"clay-jai/windows/clay",
source_file,
debug = compile_debug,
target=.NONE,
compiler_executable_path="clang",
ar_executable_path="llvm-ar",
);
command := ifx compile_debug {
Process.break_command_into_strings("clang -c source\\clay.c");
} else {
Process.break_command_into_strings("clang -O3 -c source\\clay.c");
}
result := Process.run_command(..command, capture_and_return_output=true, print_captured_output=true);
if result.exit_code != 0 then return false;
defer File.file_delete("clay.o");
// {
// command := Process.break_command_into_strings("clang -c -o clay-jai/windows/clay.lib -static source/clay.c");
// result, out, error := Process.run_command(..command, capture_and_return_output = true);
// write_string(out);
// if result.exit_code != 0
// {
// write_string("Failed to build clay. Do you have clang installed ?\n");
// write_string(error);
// success = false;
// }
// }
// {
// command := Process.break_command_into_strings("clang -c -o clay-jai/windows/clay.dll -dynamic source/clay.c");
// result, out, error := Process.run_command(..command, capture_and_return_output = true);
// write_string(out);
// if result.exit_code != 0
// {
// write_string("Failed to build clay. Do you have clang installed ?\n");
// write_string(error);
// success = false;
// }
// }
command = Process.break_command_into_strings("llvm-ar -rc clay-jai/windows/clay.lib clay.o");
result = Process.run_command(..command, capture_and_return_output=true, print_captured_output=true);
if result.exit_code != 0 then return false;
} else {
// TODO MacOS
// TODO Linux
@ -420,20 +68,22 @@ generate_bindings :: (args: [] string, minimum_os_version: type_of(Compiler.Buil
using options;
#if OS == .WINDOWS {
Basic.array_add(*libpaths, "clay-jai/windows");
array_add(*libpaths, "clay-jai/windows");
output_filename = "windows.jai";
} else {
assert(false);
}
Basic.array_add(*libnames, "clay");
Basic.array_add(*include_paths, SOURCE_PATH);
Basic.array_add(*source_files, Basic.tprint("%/clay.h", SOURCE_PATH));
Basic.array_add(*strip_prefixes, "Clay_");
array_add(*libnames, "clay");
array_add(*include_paths, SOURCE_PATH);
array_add(*source_files, tprint("%/clay.h", SOURCE_PATH));
array_add(*strip_prefixes, "Clay_");
auto_detect_enum_prefixes = true;
log_stripped_declarations = true;
generate_compile_time_struct_checks = false;
generate_compile_time_struct_checks = true;
visitor = clay_visitor;
}
could_generate := Generator.generate_bindings(options, output_filename);
@ -443,6 +93,19 @@ generate_bindings :: (args: [] string, minimum_os_version: type_of(Compiler.Buil
return could_generate;
}
clay_visitor :: (decl: *Generator.Declaration, parent_decl: *Generator.Declaration) -> Generator.Declaration_Visit_Result {
if !parent_decl
{
if array_find(DECLARATIONS_TO_OMIT, decl.name)
{
decl.decl_flags |= .OMIT_FROM_OUTPUT;
return .STOP;
}
}
return .RECURSE;
}
#scope_file
using Basic :: #import "Basic";

View File

@ -1,5 +1,13 @@
Vector2 :: Math.Vector2;
Color :: Math.Vector4;
#scope_module
Math :: #import "Math";
#if OS == .WINDOWS {
#load "windows.jai";
} else {
assert(false)
assert(false);
}

View File

@ -1,7 +1,7 @@
//
// This file was auto-generated using the following command:
//
// jai ./generate.jai - -compile
// jai generate.jai - -compile
//
@ -32,18 +32,6 @@ Dimensions :: struct {
height: float;
}
Vector2 :: struct {
x: float;
y: float;
}
Color :: struct {
r: float;
g: float;
b: float;
a: float;
}
BoundingBox :: struct {
x: float;
y: float;
@ -373,12 +361,18 @@ SetCullingEnabled :: (enabled: bool) -> void #foreign clay "Clay_SetCullingEnabl
// Internal API functions required by macros
OpenElement :: (__args: ..Any) -> void #foreign clay "Clay__OpenElement";
CloseElement :: (__args: ..Any) -> void #foreign clay "Clay__CloseElement";
StoreLayoutConfig :: (config: LayoutConfig) -> *LayoutConfig #foreign clay "Clay__StoreLayoutConfig";
ElementPostConfiguration :: (__args: ..Any) -> void #foreign clay "Clay__ElementPostConfiguration";
AttachId :: (id: ElementId) -> void #foreign clay "Clay__AttachId";
AttachLayoutConfig :: (config: *LayoutConfig) -> void #foreign clay "Clay__AttachLayoutConfig";
AttachElementConfig :: (config: ElementConfigUnion, type: ElementConfigType) -> void #foreign clay "Clay__AttachElementConfig";
StoreRectangleElementConfig :: (config: RectangleElementConfig) -> *RectangleElementConfig #foreign clay "Clay__StoreRectangleElementConfig";
StoreTextElementConfig :: (config: TextElementConfig) -> *TextElementConfig #foreign clay "Clay__StoreTextElementConfig";
StoreImageElementConfig :: (config: ImageElementConfig) -> *ImageElementConfig #foreign clay "Clay__StoreImageElementConfig";
StoreFloatingElementConfig :: (config: FloatingElementConfig) -> *FloatingElementConfig #foreign clay "Clay__StoreFloatingElementConfig";
StoreCustomElementConfig :: (config: CustomElementConfig) -> *CustomElementConfig #foreign clay "Clay__StoreCustomElementConfig";
StoreScrollElementConfig :: (config: ScrollElementConfig) -> *ScrollElementConfig #foreign clay "Clay__StoreScrollElementConfig";
StoreBorderElementConfig :: (config: BorderElementConfig) -> *BorderElementConfig #foreign clay "Clay__StoreBorderElementConfig";
HashString :: (key: String, offset: u32, seed: u32) -> ElementId #foreign clay "Clay__HashString";
Noop :: (__args: ..Any) -> void #foreign clay "Clay__Noop";
OpenTextElement :: (text: String, textConfig: *TextElementConfig) -> void #foreign clay "Clay__OpenTextElement";
@ -389,4 +383,329 @@ Clay__debugMaxElementsLatch: bool #elsewhere clay;
#scope_file
#import "Basic"; // For assert
clay :: #library,no_dll "clay-jai/windows/clay";
#run {
{
instance: String;
assert(((cast(*void)(*instance.length)) - cast(*void)(*instance)) == 0, "String.length has unexpected offset % instead of 0", ((cast(*void)(*instance.length)) - cast(*void)(*instance)));
assert(size_of(type_of(String.length)) == 4, "String.length has unexpected size % instead of 4", size_of(type_of(String.length)));
assert(((cast(*void)(*instance.chars)) - cast(*void)(*instance)) == 8, "String.chars has unexpected offset % instead of 8", ((cast(*void)(*instance.chars)) - cast(*void)(*instance)));
assert(size_of(type_of(String.chars)) == 8, "String.chars has unexpected size % instead of 8", size_of(type_of(String.chars)));
assert(size_of(String) == 16, "String has size % instead of 16", size_of(String));
}
{
instance: StringArray;
assert(((cast(*void)(*instance.capacity)) - cast(*void)(*instance)) == 0, "StringArray.capacity has unexpected offset % instead of 0", ((cast(*void)(*instance.capacity)) - cast(*void)(*instance)));
assert(size_of(type_of(StringArray.capacity)) == 4, "StringArray.capacity has unexpected size % instead of 4", size_of(type_of(StringArray.capacity)));
assert(((cast(*void)(*instance.length)) - cast(*void)(*instance)) == 4, "StringArray.length has unexpected offset % instead of 4", ((cast(*void)(*instance.length)) - cast(*void)(*instance)));
assert(size_of(type_of(StringArray.length)) == 4, "StringArray.length has unexpected size % instead of 4", size_of(type_of(StringArray.length)));
assert(((cast(*void)(*instance.internalArray)) - cast(*void)(*instance)) == 8, "StringArray.internalArray has unexpected offset % instead of 8", ((cast(*void)(*instance.internalArray)) - cast(*void)(*instance)));
assert(size_of(type_of(StringArray.internalArray)) == 8, "StringArray.internalArray has unexpected size % instead of 8", size_of(type_of(StringArray.internalArray)));
assert(size_of(StringArray) == 16, "StringArray has size % instead of 16", size_of(StringArray));
}
{
instance: Arena;
assert(((cast(*void)(*instance.label)) - cast(*void)(*instance)) == 0, "Arena.label has unexpected offset % instead of 0", ((cast(*void)(*instance.label)) - cast(*void)(*instance)));
assert(size_of(type_of(Arena.label)) == 16, "Arena.label has unexpected size % instead of 16", size_of(type_of(Arena.label)));
assert(((cast(*void)(*instance.nextAllocation)) - cast(*void)(*instance)) == 16, "Arena.nextAllocation has unexpected offset % instead of 16", ((cast(*void)(*instance.nextAllocation)) - cast(*void)(*instance)));
assert(size_of(type_of(Arena.nextAllocation)) == 8, "Arena.nextAllocation has unexpected size % instead of 8", size_of(type_of(Arena.nextAllocation)));
assert(((cast(*void)(*instance.capacity)) - cast(*void)(*instance)) == 24, "Arena.capacity has unexpected offset % instead of 24", ((cast(*void)(*instance.capacity)) - cast(*void)(*instance)));
assert(size_of(type_of(Arena.capacity)) == 8, "Arena.capacity has unexpected size % instead of 8", size_of(type_of(Arena.capacity)));
assert(((cast(*void)(*instance.memory)) - cast(*void)(*instance)) == 32, "Arena.memory has unexpected offset % instead of 32", ((cast(*void)(*instance.memory)) - cast(*void)(*instance)));
assert(size_of(type_of(Arena.memory)) == 8, "Arena.memory has unexpected size % instead of 8", size_of(type_of(Arena.memory)));
assert(size_of(Arena) == 40, "Arena has size % instead of 40", size_of(Arena));
}
{
instance: Dimensions;
assert(((cast(*void)(*instance.width)) - cast(*void)(*instance)) == 0, "Dimensions.width has unexpected offset % instead of 0", ((cast(*void)(*instance.width)) - cast(*void)(*instance)));
assert(size_of(type_of(Dimensions.width)) == 4, "Dimensions.width has unexpected size % instead of 4", size_of(type_of(Dimensions.width)));
assert(((cast(*void)(*instance.height)) - cast(*void)(*instance)) == 4, "Dimensions.height has unexpected offset % instead of 4", ((cast(*void)(*instance.height)) - cast(*void)(*instance)));
assert(size_of(type_of(Dimensions.height)) == 4, "Dimensions.height has unexpected size % instead of 4", size_of(type_of(Dimensions.height)));
assert(size_of(Dimensions) == 8, "Dimensions has size % instead of 8", size_of(Dimensions));
}
{
instance: BoundingBox;
assert(((cast(*void)(*instance.x)) - cast(*void)(*instance)) == 0, "BoundingBox.x has unexpected offset % instead of 0", ((cast(*void)(*instance.x)) - cast(*void)(*instance)));
assert(size_of(type_of(BoundingBox.x)) == 4, "BoundingBox.x has unexpected size % instead of 4", size_of(type_of(BoundingBox.x)));
assert(((cast(*void)(*instance.y)) - cast(*void)(*instance)) == 4, "BoundingBox.y has unexpected offset % instead of 4", ((cast(*void)(*instance.y)) - cast(*void)(*instance)));
assert(size_of(type_of(BoundingBox.y)) == 4, "BoundingBox.y has unexpected size % instead of 4", size_of(type_of(BoundingBox.y)));
assert(((cast(*void)(*instance.width)) - cast(*void)(*instance)) == 8, "BoundingBox.width has unexpected offset % instead of 8", ((cast(*void)(*instance.width)) - cast(*void)(*instance)));
assert(size_of(type_of(BoundingBox.width)) == 4, "BoundingBox.width has unexpected size % instead of 4", size_of(type_of(BoundingBox.width)));
assert(((cast(*void)(*instance.height)) - cast(*void)(*instance)) == 12, "BoundingBox.height has unexpected offset % instead of 12", ((cast(*void)(*instance.height)) - cast(*void)(*instance)));
assert(size_of(type_of(BoundingBox.height)) == 4, "BoundingBox.height has unexpected size % instead of 4", size_of(type_of(BoundingBox.height)));
assert(size_of(BoundingBox) == 16, "BoundingBox has size % instead of 16", size_of(BoundingBox));
}
{
instance: ElementId;
assert(((cast(*void)(*instance.id)) - cast(*void)(*instance)) == 0, "ElementId.id has unexpected offset % instead of 0", ((cast(*void)(*instance.id)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementId.id)) == 4, "ElementId.id has unexpected size % instead of 4", size_of(type_of(ElementId.id)));
assert(((cast(*void)(*instance.offset)) - cast(*void)(*instance)) == 4, "ElementId.offset has unexpected offset % instead of 4", ((cast(*void)(*instance.offset)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementId.offset)) == 4, "ElementId.offset has unexpected size % instead of 4", size_of(type_of(ElementId.offset)));
assert(((cast(*void)(*instance.baseId)) - cast(*void)(*instance)) == 8, "ElementId.baseId has unexpected offset % instead of 8", ((cast(*void)(*instance.baseId)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementId.baseId)) == 4, "ElementId.baseId has unexpected size % instead of 4", size_of(type_of(ElementId.baseId)));
assert(((cast(*void)(*instance.stringId)) - cast(*void)(*instance)) == 16, "ElementId.stringId has unexpected offset % instead of 16", ((cast(*void)(*instance.stringId)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementId.stringId)) == 16, "ElementId.stringId has unexpected size % instead of 16", size_of(type_of(ElementId.stringId)));
assert(size_of(ElementId) == 32, "ElementId has size % instead of 32", size_of(ElementId));
}
{
instance: CornerRadius;
assert(((cast(*void)(*instance.topLeft)) - cast(*void)(*instance)) == 0, "CornerRadius.topLeft has unexpected offset % instead of 0", ((cast(*void)(*instance.topLeft)) - cast(*void)(*instance)));
assert(size_of(type_of(CornerRadius.topLeft)) == 4, "CornerRadius.topLeft has unexpected size % instead of 4", size_of(type_of(CornerRadius.topLeft)));
assert(((cast(*void)(*instance.topRight)) - cast(*void)(*instance)) == 4, "CornerRadius.topRight has unexpected offset % instead of 4", ((cast(*void)(*instance.topRight)) - cast(*void)(*instance)));
assert(size_of(type_of(CornerRadius.topRight)) == 4, "CornerRadius.topRight has unexpected size % instead of 4", size_of(type_of(CornerRadius.topRight)));
assert(((cast(*void)(*instance.bottomLeft)) - cast(*void)(*instance)) == 8, "CornerRadius.bottomLeft has unexpected offset % instead of 8", ((cast(*void)(*instance.bottomLeft)) - cast(*void)(*instance)));
assert(size_of(type_of(CornerRadius.bottomLeft)) == 4, "CornerRadius.bottomLeft has unexpected size % instead of 4", size_of(type_of(CornerRadius.bottomLeft)));
assert(((cast(*void)(*instance.bottomRight)) - cast(*void)(*instance)) == 12, "CornerRadius.bottomRight has unexpected offset % instead of 12", ((cast(*void)(*instance.bottomRight)) - cast(*void)(*instance)));
assert(size_of(type_of(CornerRadius.bottomRight)) == 4, "CornerRadius.bottomRight has unexpected size % instead of 4", size_of(type_of(CornerRadius.bottomRight)));
assert(size_of(CornerRadius) == 16, "CornerRadius has size % instead of 16", size_of(CornerRadius));
}
{
instance: ChildAlignment;
assert(((cast(*void)(*instance.x)) - cast(*void)(*instance)) == 0, "ChildAlignment.x has unexpected offset % instead of 0", ((cast(*void)(*instance.x)) - cast(*void)(*instance)));
assert(size_of(type_of(ChildAlignment.x)) == 4, "ChildAlignment.x has unexpected size % instead of 4", size_of(type_of(ChildAlignment.x)));
assert(((cast(*void)(*instance.y)) - cast(*void)(*instance)) == 4, "ChildAlignment.y has unexpected offset % instead of 4", ((cast(*void)(*instance.y)) - cast(*void)(*instance)));
assert(size_of(type_of(ChildAlignment.y)) == 4, "ChildAlignment.y has unexpected size % instead of 4", size_of(type_of(ChildAlignment.y)));
assert(size_of(ChildAlignment) == 8, "ChildAlignment has size % instead of 8", size_of(ChildAlignment));
}
{
instance: SizingMinMax;
assert(((cast(*void)(*instance.min)) - cast(*void)(*instance)) == 0, "SizingMinMax.min has unexpected offset % instead of 0", ((cast(*void)(*instance.min)) - cast(*void)(*instance)));
assert(size_of(type_of(SizingMinMax.min)) == 4, "SizingMinMax.min has unexpected size % instead of 4", size_of(type_of(SizingMinMax.min)));
assert(((cast(*void)(*instance.max)) - cast(*void)(*instance)) == 4, "SizingMinMax.max has unexpected offset % instead of 4", ((cast(*void)(*instance.max)) - cast(*void)(*instance)));
assert(size_of(type_of(SizingMinMax.max)) == 4, "SizingMinMax.max has unexpected size % instead of 4", size_of(type_of(SizingMinMax.max)));
assert(size_of(SizingMinMax) == 8, "SizingMinMax has size % instead of 8", size_of(SizingMinMax));
}
{
instance: SizingAxis;
assert(((cast(*void)(*instance.type)) - cast(*void)(*instance)) == 8, "SizingAxis.type has unexpected offset % instead of 8", ((cast(*void)(*instance.type)) - cast(*void)(*instance)));
assert(size_of(type_of(SizingAxis.type)) == 4, "SizingAxis.type has unexpected size % instead of 4", size_of(type_of(SizingAxis.type)));
assert(size_of(SizingAxis) == 12, "SizingAxis has size % instead of 12", size_of(SizingAxis));
}
{
instance: Sizing;
assert(((cast(*void)(*instance.width)) - cast(*void)(*instance)) == 0, "Sizing.width has unexpected offset % instead of 0", ((cast(*void)(*instance.width)) - cast(*void)(*instance)));
assert(size_of(type_of(Sizing.width)) == 12, "Sizing.width has unexpected size % instead of 12", size_of(type_of(Sizing.width)));
assert(((cast(*void)(*instance.height)) - cast(*void)(*instance)) == 12, "Sizing.height has unexpected offset % instead of 12", ((cast(*void)(*instance.height)) - cast(*void)(*instance)));
assert(size_of(type_of(Sizing.height)) == 12, "Sizing.height has unexpected size % instead of 12", size_of(type_of(Sizing.height)));
assert(size_of(Sizing) == 24, "Sizing has size % instead of 24", size_of(Sizing));
}
{
instance: Padding;
assert(((cast(*void)(*instance.x)) - cast(*void)(*instance)) == 0, "Padding.x has unexpected offset % instead of 0", ((cast(*void)(*instance.x)) - cast(*void)(*instance)));
assert(size_of(type_of(Padding.x)) == 2, "Padding.x has unexpected size % instead of 2", size_of(type_of(Padding.x)));
assert(((cast(*void)(*instance.y)) - cast(*void)(*instance)) == 2, "Padding.y has unexpected offset % instead of 2", ((cast(*void)(*instance.y)) - cast(*void)(*instance)));
assert(size_of(type_of(Padding.y)) == 2, "Padding.y has unexpected size % instead of 2", size_of(type_of(Padding.y)));
assert(size_of(Padding) == 4, "Padding has size % instead of 4", size_of(Padding));
}
{
instance: LayoutConfig;
assert(((cast(*void)(*instance.sizing)) - cast(*void)(*instance)) == 0, "LayoutConfig.sizing has unexpected offset % instead of 0", ((cast(*void)(*instance.sizing)) - cast(*void)(*instance)));
assert(size_of(type_of(LayoutConfig.sizing)) == 24, "LayoutConfig.sizing has unexpected size % instead of 24", size_of(type_of(LayoutConfig.sizing)));
assert(((cast(*void)(*instance.padding)) - cast(*void)(*instance)) == 24, "LayoutConfig.padding has unexpected offset % instead of 24", ((cast(*void)(*instance.padding)) - cast(*void)(*instance)));
assert(size_of(type_of(LayoutConfig.padding)) == 4, "LayoutConfig.padding has unexpected size % instead of 4", size_of(type_of(LayoutConfig.padding)));
assert(((cast(*void)(*instance.childGap)) - cast(*void)(*instance)) == 28, "LayoutConfig.childGap has unexpected offset % instead of 28", ((cast(*void)(*instance.childGap)) - cast(*void)(*instance)));
assert(size_of(type_of(LayoutConfig.childGap)) == 2, "LayoutConfig.childGap has unexpected size % instead of 2", size_of(type_of(LayoutConfig.childGap)));
assert(((cast(*void)(*instance.childAlignment)) - cast(*void)(*instance)) == 32, "LayoutConfig.childAlignment has unexpected offset % instead of 32", ((cast(*void)(*instance.childAlignment)) - cast(*void)(*instance)));
assert(size_of(type_of(LayoutConfig.childAlignment)) == 8, "LayoutConfig.childAlignment has unexpected size % instead of 8", size_of(type_of(LayoutConfig.childAlignment)));
assert(((cast(*void)(*instance.layoutDirection)) - cast(*void)(*instance)) == 40, "LayoutConfig.layoutDirection has unexpected offset % instead of 40", ((cast(*void)(*instance.layoutDirection)) - cast(*void)(*instance)));
assert(size_of(type_of(LayoutConfig.layoutDirection)) == 4, "LayoutConfig.layoutDirection has unexpected size % instead of 4", size_of(type_of(LayoutConfig.layoutDirection)));
assert(size_of(LayoutConfig) == 44, "LayoutConfig has size % instead of 44", size_of(LayoutConfig));
}
{
instance: RectangleElementConfig;
assert(((cast(*void)(*instance.color)) - cast(*void)(*instance)) == 0, "RectangleElementConfig.color has unexpected offset % instead of 0", ((cast(*void)(*instance.color)) - cast(*void)(*instance)));
assert(size_of(type_of(RectangleElementConfig.color)) == 16, "RectangleElementConfig.color has unexpected size % instead of 16", size_of(type_of(RectangleElementConfig.color)));
assert(((cast(*void)(*instance.cornerRadius)) - cast(*void)(*instance)) == 16, "RectangleElementConfig.cornerRadius has unexpected offset % instead of 16", ((cast(*void)(*instance.cornerRadius)) - cast(*void)(*instance)));
assert(size_of(type_of(RectangleElementConfig.cornerRadius)) == 16, "RectangleElementConfig.cornerRadius has unexpected size % instead of 16", size_of(type_of(RectangleElementConfig.cornerRadius)));
assert(size_of(RectangleElementConfig) == 32, "RectangleElementConfig has size % instead of 32", size_of(RectangleElementConfig));
}
{
instance: TextElementConfig;
assert(((cast(*void)(*instance.textColor)) - cast(*void)(*instance)) == 0, "TextElementConfig.textColor has unexpected offset % instead of 0", ((cast(*void)(*instance.textColor)) - cast(*void)(*instance)));
assert(size_of(type_of(TextElementConfig.textColor)) == 16, "TextElementConfig.textColor has unexpected size % instead of 16", size_of(type_of(TextElementConfig.textColor)));
assert(((cast(*void)(*instance.fontId)) - cast(*void)(*instance)) == 16, "TextElementConfig.fontId has unexpected offset % instead of 16", ((cast(*void)(*instance.fontId)) - cast(*void)(*instance)));
assert(size_of(type_of(TextElementConfig.fontId)) == 2, "TextElementConfig.fontId has unexpected size % instead of 2", size_of(type_of(TextElementConfig.fontId)));
assert(((cast(*void)(*instance.fontSize)) - cast(*void)(*instance)) == 18, "TextElementConfig.fontSize has unexpected offset % instead of 18", ((cast(*void)(*instance.fontSize)) - cast(*void)(*instance)));
assert(size_of(type_of(TextElementConfig.fontSize)) == 2, "TextElementConfig.fontSize has unexpected size % instead of 2", size_of(type_of(TextElementConfig.fontSize)));
assert(((cast(*void)(*instance.letterSpacing)) - cast(*void)(*instance)) == 20, "TextElementConfig.letterSpacing has unexpected offset % instead of 20", ((cast(*void)(*instance.letterSpacing)) - cast(*void)(*instance)));
assert(size_of(type_of(TextElementConfig.letterSpacing)) == 2, "TextElementConfig.letterSpacing has unexpected size % instead of 2", size_of(type_of(TextElementConfig.letterSpacing)));
assert(((cast(*void)(*instance.lineHeight)) - cast(*void)(*instance)) == 22, "TextElementConfig.lineHeight has unexpected offset % instead of 22", ((cast(*void)(*instance.lineHeight)) - cast(*void)(*instance)));
assert(size_of(type_of(TextElementConfig.lineHeight)) == 2, "TextElementConfig.lineHeight has unexpected size % instead of 2", size_of(type_of(TextElementConfig.lineHeight)));
assert(((cast(*void)(*instance.wrapMode)) - cast(*void)(*instance)) == 24, "TextElementConfig.wrapMode has unexpected offset % instead of 24", ((cast(*void)(*instance.wrapMode)) - cast(*void)(*instance)));
assert(size_of(type_of(TextElementConfig.wrapMode)) == 4, "TextElementConfig.wrapMode has unexpected size % instead of 4", size_of(type_of(TextElementConfig.wrapMode)));
assert(size_of(TextElementConfig) == 28, "TextElementConfig has size % instead of 28", size_of(TextElementConfig));
}
{
instance: ImageElementConfig;
assert(((cast(*void)(*instance.imageData)) - cast(*void)(*instance)) == 0, "ImageElementConfig.imageData has unexpected offset % instead of 0", ((cast(*void)(*instance.imageData)) - cast(*void)(*instance)));
assert(size_of(type_of(ImageElementConfig.imageData)) == 8, "ImageElementConfig.imageData has unexpected size % instead of 8", size_of(type_of(ImageElementConfig.imageData)));
assert(((cast(*void)(*instance.sourceDimensions)) - cast(*void)(*instance)) == 8, "ImageElementConfig.sourceDimensions has unexpected offset % instead of 8", ((cast(*void)(*instance.sourceDimensions)) - cast(*void)(*instance)));
assert(size_of(type_of(ImageElementConfig.sourceDimensions)) == 8, "ImageElementConfig.sourceDimensions has unexpected size % instead of 8", size_of(type_of(ImageElementConfig.sourceDimensions)));
assert(size_of(ImageElementConfig) == 16, "ImageElementConfig has size % instead of 16", size_of(ImageElementConfig));
}
{
instance: FloatingAttachPoints;
assert(((cast(*void)(*instance.element)) - cast(*void)(*instance)) == 0, "FloatingAttachPoints.element has unexpected offset % instead of 0", ((cast(*void)(*instance.element)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingAttachPoints.element)) == 4, "FloatingAttachPoints.element has unexpected size % instead of 4", size_of(type_of(FloatingAttachPoints.element)));
assert(((cast(*void)(*instance.parent)) - cast(*void)(*instance)) == 4, "FloatingAttachPoints.parent has unexpected offset % instead of 4", ((cast(*void)(*instance.parent)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingAttachPoints.parent)) == 4, "FloatingAttachPoints.parent has unexpected size % instead of 4", size_of(type_of(FloatingAttachPoints.parent)));
assert(size_of(FloatingAttachPoints) == 8, "FloatingAttachPoints has size % instead of 8", size_of(FloatingAttachPoints));
}
{
instance: FloatingElementConfig;
assert(((cast(*void)(*instance.offset)) - cast(*void)(*instance)) == 0, "FloatingElementConfig.offset has unexpected offset % instead of 0", ((cast(*void)(*instance.offset)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingElementConfig.offset)) == 8, "FloatingElementConfig.offset has unexpected size % instead of 8", size_of(type_of(FloatingElementConfig.offset)));
assert(((cast(*void)(*instance.expand)) - cast(*void)(*instance)) == 8, "FloatingElementConfig.expand has unexpected offset % instead of 8", ((cast(*void)(*instance.expand)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingElementConfig.expand)) == 8, "FloatingElementConfig.expand has unexpected size % instead of 8", size_of(type_of(FloatingElementConfig.expand)));
assert(((cast(*void)(*instance.zIndex)) - cast(*void)(*instance)) == 16, "FloatingElementConfig.zIndex has unexpected offset % instead of 16", ((cast(*void)(*instance.zIndex)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingElementConfig.zIndex)) == 2, "FloatingElementConfig.zIndex has unexpected size % instead of 2", size_of(type_of(FloatingElementConfig.zIndex)));
assert(((cast(*void)(*instance.parentId)) - cast(*void)(*instance)) == 20, "FloatingElementConfig.parentId has unexpected offset % instead of 20", ((cast(*void)(*instance.parentId)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingElementConfig.parentId)) == 4, "FloatingElementConfig.parentId has unexpected size % instead of 4", size_of(type_of(FloatingElementConfig.parentId)));
assert(((cast(*void)(*instance.attachment)) - cast(*void)(*instance)) == 24, "FloatingElementConfig.attachment has unexpected offset % instead of 24", ((cast(*void)(*instance.attachment)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingElementConfig.attachment)) == 8, "FloatingElementConfig.attachment has unexpected size % instead of 8", size_of(type_of(FloatingElementConfig.attachment)));
assert(((cast(*void)(*instance.pointerCaptureMode)) - cast(*void)(*instance)) == 32, "FloatingElementConfig.pointerCaptureMode has unexpected offset % instead of 32", ((cast(*void)(*instance.pointerCaptureMode)) - cast(*void)(*instance)));
assert(size_of(type_of(FloatingElementConfig.pointerCaptureMode)) == 4, "FloatingElementConfig.pointerCaptureMode has unexpected size % instead of 4", size_of(type_of(FloatingElementConfig.pointerCaptureMode)));
assert(size_of(FloatingElementConfig) == 36, "FloatingElementConfig has size % instead of 36", size_of(FloatingElementConfig));
}
{
instance: CustomElementConfig;
assert(((cast(*void)(*instance.customData)) - cast(*void)(*instance)) == 0, "CustomElementConfig.customData has unexpected offset % instead of 0", ((cast(*void)(*instance.customData)) - cast(*void)(*instance)));
assert(size_of(type_of(CustomElementConfig.customData)) == 8, "CustomElementConfig.customData has unexpected size % instead of 8", size_of(type_of(CustomElementConfig.customData)));
assert(size_of(CustomElementConfig) == 8, "CustomElementConfig has size % instead of 8", size_of(CustomElementConfig));
}
{
instance: ScrollElementConfig;
assert(((cast(*void)(*instance.horizontal)) - cast(*void)(*instance)) == 0, "ScrollElementConfig.horizontal has unexpected offset % instead of 0", ((cast(*void)(*instance.horizontal)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollElementConfig.horizontal)) == 1, "ScrollElementConfig.horizontal has unexpected size % instead of 1", size_of(type_of(ScrollElementConfig.horizontal)));
assert(((cast(*void)(*instance.vertical)) - cast(*void)(*instance)) == 1, "ScrollElementConfig.vertical has unexpected offset % instead of 1", ((cast(*void)(*instance.vertical)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollElementConfig.vertical)) == 1, "ScrollElementConfig.vertical has unexpected size % instead of 1", size_of(type_of(ScrollElementConfig.vertical)));
assert(size_of(ScrollElementConfig) == 2, "ScrollElementConfig has size % instead of 2", size_of(ScrollElementConfig));
}
{
instance: Border;
assert(((cast(*void)(*instance.width)) - cast(*void)(*instance)) == 0, "Border.width has unexpected offset % instead of 0", ((cast(*void)(*instance.width)) - cast(*void)(*instance)));
assert(size_of(type_of(Border.width)) == 4, "Border.width has unexpected size % instead of 4", size_of(type_of(Border.width)));
assert(((cast(*void)(*instance.color)) - cast(*void)(*instance)) == 4, "Border.color has unexpected offset % instead of 4", ((cast(*void)(*instance.color)) - cast(*void)(*instance)));
assert(size_of(type_of(Border.color)) == 16, "Border.color has unexpected size % instead of 16", size_of(type_of(Border.color)));
assert(size_of(Border) == 20, "Border has size % instead of 20", size_of(Border));
}
{
instance: BorderElementConfig;
assert(((cast(*void)(*instance.left)) - cast(*void)(*instance)) == 0, "BorderElementConfig.left has unexpected offset % instead of 0", ((cast(*void)(*instance.left)) - cast(*void)(*instance)));
assert(size_of(type_of(BorderElementConfig.left)) == 20, "BorderElementConfig.left has unexpected size % instead of 20", size_of(type_of(BorderElementConfig.left)));
assert(((cast(*void)(*instance.right)) - cast(*void)(*instance)) == 20, "BorderElementConfig.right has unexpected offset % instead of 20", ((cast(*void)(*instance.right)) - cast(*void)(*instance)));
assert(size_of(type_of(BorderElementConfig.right)) == 20, "BorderElementConfig.right has unexpected size % instead of 20", size_of(type_of(BorderElementConfig.right)));
assert(((cast(*void)(*instance.top)) - cast(*void)(*instance)) == 40, "BorderElementConfig.top has unexpected offset % instead of 40", ((cast(*void)(*instance.top)) - cast(*void)(*instance)));
assert(size_of(type_of(BorderElementConfig.top)) == 20, "BorderElementConfig.top has unexpected size % instead of 20", size_of(type_of(BorderElementConfig.top)));
assert(((cast(*void)(*instance.bottom)) - cast(*void)(*instance)) == 60, "BorderElementConfig.bottom has unexpected offset % instead of 60", ((cast(*void)(*instance.bottom)) - cast(*void)(*instance)));
assert(size_of(type_of(BorderElementConfig.bottom)) == 20, "BorderElementConfig.bottom has unexpected size % instead of 20", size_of(type_of(BorderElementConfig.bottom)));
assert(((cast(*void)(*instance.betweenChildren)) - cast(*void)(*instance)) == 80, "BorderElementConfig.betweenChildren has unexpected offset % instead of 80", ((cast(*void)(*instance.betweenChildren)) - cast(*void)(*instance)));
assert(size_of(type_of(BorderElementConfig.betweenChildren)) == 20, "BorderElementConfig.betweenChildren has unexpected size % instead of 20", size_of(type_of(BorderElementConfig.betweenChildren)));
assert(((cast(*void)(*instance.cornerRadius)) - cast(*void)(*instance)) == 100, "BorderElementConfig.cornerRadius has unexpected offset % instead of 100", ((cast(*void)(*instance.cornerRadius)) - cast(*void)(*instance)));
assert(size_of(type_of(BorderElementConfig.cornerRadius)) == 16, "BorderElementConfig.cornerRadius has unexpected size % instead of 16", size_of(type_of(BorderElementConfig.cornerRadius)));
assert(size_of(BorderElementConfig) == 116, "BorderElementConfig has size % instead of 116", size_of(BorderElementConfig));
}
{
instance: ElementConfigUnion;
assert(((cast(*void)(*instance.rectangleElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.rectangleElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.rectangleElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.rectangleElementConfig)) == 8, "ElementConfigUnion.rectangleElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.rectangleElementConfig)));
assert(((cast(*void)(*instance.textElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.textElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.textElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.textElementConfig)) == 8, "ElementConfigUnion.textElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.textElementConfig)));
assert(((cast(*void)(*instance.imageElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.imageElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.imageElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.imageElementConfig)) == 8, "ElementConfigUnion.imageElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.imageElementConfig)));
assert(((cast(*void)(*instance.floatingElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.floatingElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.floatingElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.floatingElementConfig)) == 8, "ElementConfigUnion.floatingElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.floatingElementConfig)));
assert(((cast(*void)(*instance.customElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.customElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.customElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.customElementConfig)) == 8, "ElementConfigUnion.customElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.customElementConfig)));
assert(((cast(*void)(*instance.scrollElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.scrollElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.scrollElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.scrollElementConfig)) == 8, "ElementConfigUnion.scrollElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.scrollElementConfig)));
assert(((cast(*void)(*instance.borderElementConfig)) - cast(*void)(*instance)) == 0, "ElementConfigUnion.borderElementConfig has unexpected offset % instead of 0", ((cast(*void)(*instance.borderElementConfig)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfigUnion.borderElementConfig)) == 8, "ElementConfigUnion.borderElementConfig has unexpected size % instead of 8", size_of(type_of(ElementConfigUnion.borderElementConfig)));
assert(size_of(ElementConfigUnion) == 8, "ElementConfigUnion has size % instead of 8", size_of(ElementConfigUnion));
}
{
instance: ElementConfig;
assert(((cast(*void)(*instance.type)) - cast(*void)(*instance)) == 0, "ElementConfig.type has unexpected offset % instead of 0", ((cast(*void)(*instance.type)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfig.type)) == 4, "ElementConfig.type has unexpected size % instead of 4", size_of(type_of(ElementConfig.type)));
assert(((cast(*void)(*instance.config)) - cast(*void)(*instance)) == 8, "ElementConfig.config has unexpected offset % instead of 8", ((cast(*void)(*instance.config)) - cast(*void)(*instance)));
assert(size_of(type_of(ElementConfig.config)) == 8, "ElementConfig.config has unexpected size % instead of 8", size_of(type_of(ElementConfig.config)));
assert(size_of(ElementConfig) == 16, "ElementConfig has size % instead of 16", size_of(ElementConfig));
}
{
instance: ScrollContainerData;
assert(((cast(*void)(*instance.scrollPosition)) - cast(*void)(*instance)) == 0, "ScrollContainerData.scrollPosition has unexpected offset % instead of 0", ((cast(*void)(*instance.scrollPosition)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollContainerData.scrollPosition)) == 8, "ScrollContainerData.scrollPosition has unexpected size % instead of 8", size_of(type_of(ScrollContainerData.scrollPosition)));
assert(((cast(*void)(*instance.scrollContainerDimensions)) - cast(*void)(*instance)) == 8, "ScrollContainerData.scrollContainerDimensions has unexpected offset % instead of 8", ((cast(*void)(*instance.scrollContainerDimensions)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollContainerData.scrollContainerDimensions)) == 8, "ScrollContainerData.scrollContainerDimensions has unexpected size % instead of 8", size_of(type_of(ScrollContainerData.scrollContainerDimensions)));
assert(((cast(*void)(*instance.contentDimensions)) - cast(*void)(*instance)) == 16, "ScrollContainerData.contentDimensions has unexpected offset % instead of 16", ((cast(*void)(*instance.contentDimensions)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollContainerData.contentDimensions)) == 8, "ScrollContainerData.contentDimensions has unexpected size % instead of 8", size_of(type_of(ScrollContainerData.contentDimensions)));
assert(((cast(*void)(*instance.config)) - cast(*void)(*instance)) == 24, "ScrollContainerData.config has unexpected offset % instead of 24", ((cast(*void)(*instance.config)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollContainerData.config)) == 2, "ScrollContainerData.config has unexpected size % instead of 2", size_of(type_of(ScrollContainerData.config)));
assert(((cast(*void)(*instance.found)) - cast(*void)(*instance)) == 26, "ScrollContainerData.found has unexpected offset % instead of 26", ((cast(*void)(*instance.found)) - cast(*void)(*instance)));
assert(size_of(type_of(ScrollContainerData.found)) == 1, "ScrollContainerData.found has unexpected size % instead of 1", size_of(type_of(ScrollContainerData.found)));
assert(size_of(ScrollContainerData) == 32, "ScrollContainerData has size % instead of 32", size_of(ScrollContainerData));
}
{
instance: RenderCommand;
assert(((cast(*void)(*instance.boundingBox)) - cast(*void)(*instance)) == 0, "RenderCommand.boundingBox has unexpected offset % instead of 0", ((cast(*void)(*instance.boundingBox)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommand.boundingBox)) == 16, "RenderCommand.boundingBox has unexpected size % instead of 16", size_of(type_of(RenderCommand.boundingBox)));
assert(((cast(*void)(*instance.config)) - cast(*void)(*instance)) == 16, "RenderCommand.config has unexpected offset % instead of 16", ((cast(*void)(*instance.config)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommand.config)) == 8, "RenderCommand.config has unexpected size % instead of 8", size_of(type_of(RenderCommand.config)));
assert(((cast(*void)(*instance.text)) - cast(*void)(*instance)) == 24, "RenderCommand.text has unexpected offset % instead of 24", ((cast(*void)(*instance.text)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommand.text)) == 16, "RenderCommand.text has unexpected size % instead of 16", size_of(type_of(RenderCommand.text)));
assert(((cast(*void)(*instance.id)) - cast(*void)(*instance)) == 40, "RenderCommand.id has unexpected offset % instead of 40", ((cast(*void)(*instance.id)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommand.id)) == 4, "RenderCommand.id has unexpected size % instead of 4", size_of(type_of(RenderCommand.id)));
assert(((cast(*void)(*instance.commandType)) - cast(*void)(*instance)) == 44, "RenderCommand.commandType has unexpected offset % instead of 44", ((cast(*void)(*instance.commandType)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommand.commandType)) == 4, "RenderCommand.commandType has unexpected size % instead of 4", size_of(type_of(RenderCommand.commandType)));
assert(size_of(RenderCommand) == 48, "RenderCommand has size % instead of 48", size_of(RenderCommand));
}
{
instance: RenderCommandArray;
assert(((cast(*void)(*instance.capacity)) - cast(*void)(*instance)) == 0, "RenderCommandArray.capacity has unexpected offset % instead of 0", ((cast(*void)(*instance.capacity)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommandArray.capacity)) == 4, "RenderCommandArray.capacity has unexpected size % instead of 4", size_of(type_of(RenderCommandArray.capacity)));
assert(((cast(*void)(*instance.length)) - cast(*void)(*instance)) == 4, "RenderCommandArray.length has unexpected offset % instead of 4", ((cast(*void)(*instance.length)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommandArray.length)) == 4, "RenderCommandArray.length has unexpected size % instead of 4", size_of(type_of(RenderCommandArray.length)));
assert(((cast(*void)(*instance.internalArray)) - cast(*void)(*instance)) == 8, "RenderCommandArray.internalArray has unexpected offset % instead of 8", ((cast(*void)(*instance.internalArray)) - cast(*void)(*instance)));
assert(size_of(type_of(RenderCommandArray.internalArray)) == 8, "RenderCommandArray.internalArray has unexpected size % instead of 8", size_of(type_of(RenderCommandArray.internalArray)));
assert(size_of(RenderCommandArray) == 16, "RenderCommandArray has size % instead of 16", size_of(RenderCommandArray));
}
{
instance: PointerData;
assert(((cast(*void)(*instance.position)) - cast(*void)(*instance)) == 0, "PointerData.position has unexpected offset % instead of 0", ((cast(*void)(*instance.position)) - cast(*void)(*instance)));
assert(size_of(type_of(PointerData.position)) == 8, "PointerData.position has unexpected size % instead of 8", size_of(type_of(PointerData.position)));
assert(((cast(*void)(*instance.state)) - cast(*void)(*instance)) == 8, "PointerData.state has unexpected offset % instead of 8", ((cast(*void)(*instance.state)) - cast(*void)(*instance)));
assert(size_of(type_of(PointerData.state)) == 4, "PointerData.state has unexpected size % instead of 4", size_of(type_of(PointerData.state)));
assert(size_of(PointerData) == 12, "PointerData has size % instead of 12", size_of(PointerData));
}
}