From be02bdfd9c074494590be694245def8c289ab8d8 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Mon, 31 Jul 2017 19:00:15 +0700 Subject: [PATCH] Put internal types in their modules --- godot/core/arrays.nim | 2 +- godot/core/dictionaries.nim | 3 +-- godot/core/rids.nim | 2 +- godot/core/variants.nim | 6 ++---- godot/godotinternal.nim | 4 ++-- godot/internal/godotarrays.nim | 6 +++++- godot/internal/godotdictionaries.nim | 2 +- godot/internal/godotinternaltypes.nim | 8 -------- godot/internal/godotobjects.nim | 4 ++++ godot/internal/godotpoolarrays.nim | 8 +++----- godot/internal/godotvariants.nim | 7 +++++-- godot/nim/godotmacros.nim | 2 +- godot/nim/godotnim.nim | 2 +- 13 files changed, 27 insertions(+), 29 deletions(-) delete mode 100644 godot/internal/godotinternaltypes.nim create mode 100644 godot/internal/godotobjects.nim diff --git a/godot/core/arrays.nim b/godot/core/arrays.nim index b2fc4e9..9ec5b68 100644 --- a/godot/core/arrays.nim +++ b/godot/core/arrays.nim @@ -1,7 +1,7 @@ # Copyright 2017 Xored Software, Inc. import hashes -import internal.godotinternaltypes, internal.godotarrays +import internal.godotarrays type Array* = ref object diff --git a/godot/core/dictionaries.nim b/godot/core/dictionaries.nim index d25e19f..6be9bf6 100644 --- a/godot/core/dictionaries.nim +++ b/godot/core/dictionaries.nim @@ -1,8 +1,7 @@ # Copyright 2017 Xored Software, Inc. import hashes -import internal.godotinternaltypes, internal.godotstrings, - internal.godotdictionaries, internal.godotvariants +import internal / [godotstrings, godotdictionaries, godotvariants] type Dictionary* = ref object diff --git a/godot/core/rids.nim b/godot/core/rids.nim index b63875c..82a5154 100644 --- a/godot/core/rids.nim +++ b/godot/core/rids.nim @@ -1,4 +1,4 @@ -import internal.godotinternaltypes +import internal.godotobjects type RID* {.byref.} = object diff --git a/godot/core/variants.nim b/godot/core/variants.nim index 628adb4..f1efd9e 100644 --- a/godot/core/variants.nim +++ b/godot/core/variants.nim @@ -1,9 +1,7 @@ import tables -import internal.godotinternaltypes -import internal.godotvariants -import internal.godotpoolarrays, internal.godotstrings, - internal.godotnodepaths +import internal / [godotobjects, godotvariants, godotpoolarrays, godotstrings, + godotnodepaths] type Variant* = ref object diff --git a/godot/godotinternal.nim b/godot/godotinternal.nim index 0ec3959..0fd8cb9 100644 --- a/godot/godotinternal.nim +++ b/godot/godotinternal.nim @@ -1,10 +1,10 @@ # Copyright 2017 Xored Software, Inc. import internal / [ - godotinternaltypes, godotarrays, godotnodepaths, godotpoolarrays, + godotobjects, godotarrays, godotnodepaths, godotpoolarrays, godotstrings, godotvariants, godotdictionaries] -export godotinternaltypes, godotarrays, godotnodepaths, godotpoolarrays, +export godotobjects, godotarrays, godotnodepaths, godotpoolarrays, godotstrings, godotvariants, godotdictionaries const MAX_ARG_COUNT* = 128 diff --git a/godot/internal/godotarrays.nim b/godot/internal/godotarrays.nim index c74a9ff..f63f3ce 100644 --- a/godot/internal/godotarrays.nim +++ b/godot/internal/godotarrays.nim @@ -1,7 +1,11 @@ # Copyright (c) 2017 Xored Software, Inc. +type + GodotArray* {.byref.} = object + p: pointer + import hashes -import godotinternaltypes, godotpoolarrays, godotvariants, godotstrings +import godotobjects, godotpoolarrays, godotvariants, godotstrings proc initGodotArray*(dest: var GodotArray) {. importc: "godot_array_new".} diff --git a/godot/internal/godotdictionaries.nim b/godot/internal/godotdictionaries.nim index 715b030..24fee10 100644 --- a/godot/internal/godotdictionaries.nim +++ b/godot/internal/godotdictionaries.nim @@ -4,7 +4,7 @@ type GodotDictionary* {.byref.} = object p: pointer -import godotinternaltypes, godotarrays, godotvariants, godotstrings +import godotarrays, godotvariants, godotstrings proc initGodotDictionary*(dest: var GodotDictionary; src: GodotDictionary) {. importc: "godot_dictionary_new_copy".} diff --git a/godot/internal/godotinternaltypes.nim b/godot/internal/godotinternaltypes.nim deleted file mode 100644 index 8ccbc06..0000000 --- a/godot/internal/godotinternaltypes.nim +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Xored Software, Inc. - -type - GodotObject* = object - GodotArray* {.byref.} = object - p: pointer - GodotVariant* {.byref.} = object - data: array[24, byte] \ No newline at end of file diff --git a/godot/internal/godotobjects.nim b/godot/internal/godotobjects.nim new file mode 100644 index 0000000..9286098 --- /dev/null +++ b/godot/internal/godotobjects.nim @@ -0,0 +1,4 @@ +# Copyright 2017 Xored Software, Inc. + +type + GodotObject* = object diff --git a/godot/internal/godotpoolarrays.nim b/godot/internal/godotpoolarrays.nim index 50f8656..ab4504c 100644 --- a/godot/internal/godotpoolarrays.nim +++ b/godot/internal/godotpoolarrays.nim @@ -1,10 +1,5 @@ # Copyright (c) 2017 Xored Software, Inc. - -import godotinternaltypes, godotstrings -import core.godotbase, core.colors, - core.vector2, core.vector3 - type GodotPoolByteArray* {.byref.} = object p: pointer @@ -21,6 +16,9 @@ type GodotPoolColorArray* {.byref.} = object p: pointer +import godotstrings, godotarrays +import core / [godotbase, colors, vector2, vector3] + # byte proc initGodotPoolByteArray*(dest: var GodotPoolByteArray) {. diff --git a/godot/internal/godotvariants.nim b/godot/internal/godotvariants.nim index 13c0f59..56a125d 100644 --- a/godot/internal/godotvariants.nim +++ b/godot/internal/godotvariants.nim @@ -45,8 +45,11 @@ type argument*: cint expected*: VariantType -import godotinternaltypes, godotpoolarrays, godotstrings, godotnodepaths, - godotdictionaries + GodotVariant* {.byref.} = object + data: array[24, byte] + +import godotobjects, godotarrays, godotpoolarrays, + godotstrings, godotnodepaths, godotdictionaries import core.vector2, core.rect2, core.vector3, core.transform2d, core.planes, diff --git a/godot/nim/godotmacros.nim b/godot/nim/godotmacros.nim index 964cb1d..bebb234 100644 --- a/godot/nim/godotmacros.nim +++ b/godot/nim/godotmacros.nim @@ -1,7 +1,7 @@ # Copyright 2017 Xored Software, Inc. import macros, tables, typetraits -import "../godotinternal.nim", internal.godotvariants +import godotinternal, internal.godotvariants import godotnim, core.variants type diff --git a/godot/nim/godotnim.nim b/godot/nim/godotnim.nim index 450571b..7639c78 100644 --- a/godot/nim/godotnim.nim +++ b/godot/nim/godotnim.nim @@ -8,7 +8,7 @@ import core.vector2, core.rect2, core.basis, core.transforms, core.colors, core.nodepaths, core.rids, core.dictionaries, core.arrays, core.poolarrays, core.variants -import "../godotinternal.nim" +import godotinternal ## Definition of NimGodotObject and converters for built-in types.