Skip to content

Commit 8694297

Browse files
committed
Reorganize modules for "builtin sidecars"
1 parent 295029c commit 8694297

File tree

12 files changed

+60
-42
lines changed

12 files changed

+60
-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: 26 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,7 +56,29 @@ pub mod __prelude_reexport {
5956
pub use crate::static_sname;
6057
}
6158

59+
// #[doc(hidden)]
60+
// pub mod __sidecar_reexport {
61+
pub use crate::gen::builtin_classes::*;
62+
63+
// Special case for gstring + string_name modules, which have also manually-defined symbols.
64+
65+
/// Manual symbols and default extenders for builtin type [`GString`].
66+
pub mod gstring {
67+
pub use crate::builtin::strings::{GStringExFind as ExFind, GStringExSplit as ExSplit};
68+
pub use crate::gen::builtin_classes::gstring::*;
69+
}
70+
71+
/// Manual symbols and default extenders for builtin type [`StringName`].
72+
pub mod string_name {
73+
pub use crate::builtin::strings::{
74+
StringNameExFind as ExFind, StringNameExSplit as ExSplit, TransientStringNameOrd,
75+
};
76+
pub use crate::gen::builtin_classes::string_name::*;
77+
}
78+
// }
79+
6280
pub use __prelude_reexport::*;
81+
// pub use __sidecar_reexport::*;
6382

6483
/// Math-related functions and traits like [`ApproxEq`][math::ApproxEq].
6584
pub mod math;
@@ -70,17 +89,6 @@ pub mod iter {
7089
pub use super::collections::iterators::*;
7190
}
7291

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-
8492
pub(crate) mod meta_reexport {
8593
pub use super::collections::PackedArrayElement;
8694
}
@@ -93,22 +101,19 @@ mod macros;
93101

94102
// Other modules
95103
mod aabb;
96-
mod basis;
97104
mod callable;
98105
mod collections;
99106
mod color;
100107
mod color_constants; // After color, so that constants are listed after methods in docs (alphabetic ensures that).
101108
mod color_hsv;
109+
mod matrices;
102110
mod plane;
103-
mod projection;
104111
mod quaternion;
105112
mod rect2;
106113
mod rect2i;
107114
mod rid;
108115
mod signal;
109-
mod string;
110-
mod transform2d;
111-
mod transform3d;
116+
mod strings;
112117
mod variant;
113118
mod vectors;
114119

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)