-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
811: Simplify module structure II r=Bromeon a=Bromeon This PR is a continuation of #788 and addresses the remaining, somewhat ambitious tasks for module cleanup. Goals: * Every symbol appears at most once in prelude * Every symbol appears at exactly once outside prelude * 2-3 modules (inside the crate) are the maximum nesting depth * Modules named according to related functionality from user point of view Changes: 1. `nativescript` module * Rename to `export`. Rationale: "native script" is quite a wide term, while most the module's current functionality is directly related to _exporting_ symbols from Rust. In practice, godot-rust is always (?) used as a native script. Other potential use cases, as a pure Godot API library or with native_calls, seem to be the exception, if at all. * Along with renaming, the `nativescript` feature is removed. * Nested symbols in `export::{properties, methods}` are moved one level up. * As a result, we can avoid very long qualifiers and multiple candidates for `use` statements. * `nativescript::init::property::hint::EnumHint` -> `export::hint::EnumHint` * `nativescript::export::method::MethodBuilder` -> `export::MethodBuilder` 1. `api` module * Remove inner types like `api::area::Area`, as they are already present in `api`. * Remove all modules which would then become empty. * Create doc links between class (`Camera2D`) and related module (`camera_2d`). 1. Smaller top-level modules * Add `init` (previously part of `nativescript`). * Add `profiler` (previously part of `nativescript`). * Extend `log` with related macros. * Remove `macros` and distribute its symbols to the most fitting API. 1. `prelude` module * Remove a few macros (`godot_gdnative_init` etc.) from the prelude, suggesting that `godot_init` should be used. * `user_data` symbols are accessible through `prelude::user_data` instead of `prelude` directly. This mirrors common usage in examples. 1. `core_types` module No changes in this PR; see PR discussion for reasons and potential alternatives. Co-authored-by: Jan Haller <[email protected]>
- Loading branch information
Showing
51 changed files
with
894 additions
and
844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.