Skip to content

Commit 958f036

Browse files
committed
Move GodotObject, Null, NewRef, Ref, TRef to 'object' module; remove from top-level
Adjust imports in derive macros, examples and UI tests
1 parent e83dd6a commit 958f036

File tree

26 files changed

+39
-41
lines changed

26 files changed

+39
-41
lines changed

examples/dodge_the_creeps/src/main_scene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl Main {
140140
/// scene as the root. For instance Spatial is used for this example.
141141
fn instance_scene<Root>(scene: &Ref<PackedScene, Shared>) -> Ref<Root, Unique>
142142
where
143-
Root: gdnative::GodotObject<RefKind = ManuallyManaged> + SubClass<Node>,
143+
Root: gdnative::object::GodotObject<RefKind = ManuallyManaged> + SubClass<Node>,
144144
{
145145
let scene = unsafe { scene.assume_safe() };
146146

examples/scene_create/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub fn load_scene(path: &str) -> Option<Ref<PackedScene, ThreadLocal>> {
116116
/// scene as the root. For instance Spatial is used for this example.
117117
fn instance_scene<Root>(scene: &PackedScene) -> Result<Ref<Root, Unique>, ManageErrs>
118118
where
119-
Root: gdnative::GodotObject<RefKind = ManuallyManaged> + SubClass<Node>,
119+
Root: gdnative::object::GodotObject<RefKind = ManuallyManaged> + SubClass<Node>,
120120
{
121121
let instance = scene
122122
.instance(PackedScene::GEN_EDIT_STATE_DISABLED)

gdnative-bindings/src/generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use std::sync::Once;
99
use gdnative_core::core_types::*;
1010
use gdnative_core::object::*;
1111
use gdnative_core::private::get_api;
12+
use gdnative_core::ref_kind;
1213
use gdnative_core::sys;
1314
use gdnative_core::sys::GodotApi;
1415
use gdnative_core::thread_access;
15-
use gdnative_core::{ref_kind, GodotResult};
1616

1717
include!(concat!(env!("OUT_DIR"), "/generated.rs"));

gdnative-bindings/src/utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
33
use super::generated::{Engine, Node, SceneTree};
44
use gdnative_core::nativescript::{NativeClass, RefInstance};
5-
use gdnative_core::object::SubClass;
5+
use gdnative_core::object::{SubClass, TRef};
66
use gdnative_core::thread_access::Shared;
7-
use gdnative_core::TRef;
87

98
/// Convenience method to obtain a reference to an "auto-load" node, that is a child of the root
109
/// node. Returns `None` if the node does not exist or is not of the correct type.

gdnative-core/src/core_types/byte_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub type ByteArray = TypedArray<u8>;
55

66
godot_test!(
77
test_byte_array_access {
8-
use crate::NewRef as _;
8+
use crate::object::NewRef as _;
99

1010
let arr = (0..8).collect::<ByteArray>();
1111

gdnative-core/src/core_types/color_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub type ColorArray = TypedArray<Color>;
66

77
godot_test!(
88
test_color_array_access {
9-
use crate::NewRef as _;
9+
use crate::object::NewRef as _;
1010

1111
let arr = ColorArray::from_vec(vec![
1212
Color::from_rgb(1.0, 0.0, 0.0),

gdnative-core/src/core_types/dictionary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::core_types::ToVariant;
1212
use crate::core_types::ToVariantEq;
1313
use crate::core_types::Variant;
1414
use crate::core_types::VariantArray;
15-
use crate::NewRef;
15+
use crate::object::NewRef;
1616
use std::fmt;
1717

1818
use crate::thread_access::*;

gdnative-core/src/core_types/float32_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub type Float32Array = TypedArray<f32>;
55

66
godot_test!(
77
test_float32_array_access {
8-
use crate::NewRef as _;
8+
use crate::object::NewRef as _;
99

1010
let arr = (0..8).map(|i| i as f32).collect::<Float32Array>();
1111

gdnative-core/src/core_types/int32_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub type Int32Array = TypedArray<i32>;
55

66
godot_test!(
77
test_int32_array_access {
8-
use crate::NewRef as _;
8+
use crate::object::NewRef as _;
99

1010
let arr = (0..8).collect::<Int32Array>();
1111

gdnative-core/src/core_types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub use rid::*;
4444
pub use string::*;
4545
pub use string_array::*;
4646
pub use transform2d::*;
47-
pub use typed_array::{Element, TypedArray};
47+
pub use typed_array::*; // TODO rename Element to something more specific
4848
pub use variant::*;
4949
pub use variant_array::*;
5050
pub use vector2::*;

0 commit comments

Comments
 (0)