Skip to content

Commit a18c1da

Browse files
committed
Reorganize modules for "builtin sidecars"
1 parent 322de96 commit a18c1da

File tree

12 files changed

+54
-42
lines changed

12 files changed

+54
-42
lines changed
File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) godot-rust; Bromeon and contributors.
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
8+
mod basis;
9+
mod projection;
10+
mod transform2d;
11+
mod transform3d;
12+
13+
pub use basis::*;
14+
pub use projection::*;
15+
pub use transform2d::*;
16+
pub use transform3d::*;

godot-core/src/builtin/projection.rs renamed to godot-core/src/builtin/matrices/projection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use std::ops::Mul;
1010
use godot_ffi as sys;
1111
use sys::{ffi_methods, ExtVariantType, GodotFfi};
1212

13-
use super::{Aabb, Rect2, Vector3};
1413
use crate::builtin::math::{ApproxEq, GlamConv, GlamType};
1514
use crate::builtin::{
16-
inner, real, Plane, RMat4, RealConv, Transform3D, Vector2, Vector4, Vector4Axis,
15+
inner, real, Aabb, Plane, RMat4, RealConv, Rect2, Transform3D, Vector2, Vector3, Vector4,
16+
Vector4Axis,
1717
};
1818

1919
/// A 4x4 matrix used for 3D projective transformations.

godot-core/src/builtin/mod.rs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,19 @@ pub mod __prelude_reexport {
2828
use super::*;
2929

3030
pub use aabb::*;
31-
pub use basis::*;
3231
pub use callable::*;
3332
pub use collections::containers::*;
3433
pub use color::*;
3534
pub use color_hsv::*;
35+
pub use matrices::*;
3636
pub use plane::*;
37-
pub use projection::*;
3837
pub use quaternion::*;
3938
pub use real_inner::*;
4039
pub use rect2::*;
4140
pub use rect2i::*;
4241
pub use rid::*;
4342
pub use signal::*;
44-
pub use string::{Encoding, GString, NodePath, StringName};
45-
pub use transform2d::*;
46-
pub use transform3d::*;
43+
pub use strings::{Encoding, GString, NodePath, StringName};
4744
pub use variant::*;
4845
pub use vectors::*;
4946

@@ -59,6 +56,22 @@ pub mod __prelude_reexport {
5956
pub use crate::static_sname;
6057
}
6158

59+
pub use crate::gen::builtin_classes::*;
60+
61+
/// Manual symbols and default extenders for builtin type [`GString`].
62+
pub mod gstring {
63+
pub use crate::builtin::strings::{GStringExFind as ExFind, GStringExSplit as ExSplit};
64+
pub use crate::gen::builtin_classes::gstring::*;
65+
}
66+
67+
/// Manual symbols and default extenders for builtin type [`StringName`].
68+
pub mod string_name {
69+
pub use crate::builtin::strings::{
70+
StringNameExFind as ExFind, StringNameExSplit as ExSplit, TransientStringNameOrd,
71+
};
72+
pub use crate::gen::builtin_classes::string_name::*;
73+
}
74+
6275
pub use __prelude_reexport::*;
6376

6477
/// Math-related functions and traits like [`ApproxEq`][math::ApproxEq].
@@ -70,17 +83,6 @@ pub mod iter {
7083
pub use super::collections::iterators::*;
7184
}
7285

73-
/// Specialized types related to Godot's various string implementations.
74-
pub mod strings {
75-
pub use super::string::{
76-
ExGStringFind, ExGStringSplit, ExStringNameFind, ExStringNameSplit, TransientStringNameOrd,
77-
};
78-
}
79-
80-
pub mod sidecars {
81-
pub use crate::gen::builtin_classes::*;
82-
}
83-
8486
pub(crate) mod meta_reexport {
8587
pub use super::collections::PackedArrayElement;
8688
}
@@ -93,22 +95,19 @@ mod macros;
9395

9496
// Other modules
9597
mod aabb;
96-
mod basis;
9798
mod callable;
9899
mod collections;
99100
mod color;
100101
mod color_constants; // After color, so that constants are listed after methods in docs (alphabetic ensures that).
101102
mod color_hsv;
103+
mod matrices;
102104
mod plane;
103-
mod projection;
104105
mod quaternion;
105106
mod rect2;
106107
mod rect2i;
107108
mod rid;
108109
mod signal;
109-
mod string;
110-
mod transform2d;
111-
mod transform3d;
110+
mod strings;
112111
mod variant;
113112
mod vectors;
114113

godot-core/src/builtin/string/gstring.rs renamed to godot-core/src/builtin/strings/gstring.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use godot_ffi as sys;
1313
use sys::types::OpaqueString;
1414
use sys::{ffi_methods, interface_fn, ExtVariantType, GodotFfi};
1515

16-
use crate::builtin::string::{pad_if_needed, Encoding};
16+
use crate::builtin::strings::{pad_if_needed, Encoding};
1717
use crate::builtin::{inner, NodePath, StringName, Variant};
1818
use crate::meta::error::StringError;
1919
use crate::meta::AsArg;
@@ -312,8 +312,7 @@ impl_builtin_traits! {
312312

313313
impl_shared_string_api! {
314314
builtin: GString,
315-
find_builder: ExGStringFind,
316-
split_builder: ExGStringSplit,
315+
builtin_mod: gstring,
317316
}
318317

319318
impl fmt::Display for GString {
File renamed without changes.

godot-core/src/builtin/string/mod.rs renamed to godot-core/src/builtin/strings/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ mod node_path;
1313
mod string_macros;
1414
mod string_name;
1515

16-
pub use gstring::*;
16+
pub use gstring::{ExFind as GStringExFind, ExSplit as GStringExSplit, *};
1717
pub use node_path::NodePath;
18-
pub use string_name::*;
18+
pub use string_name::{ExFind as StringNameExFind, ExSplit as StringNameExSplit, *};
1919

2020
use crate::meta;
2121
use crate::meta::error::ConvertError;

0 commit comments

Comments
 (0)