Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
nigig-map / test (push) Has been cancelled
- nigig-build: cad-ui + construction_frame host-only (DO NOT enable unconditionally: CadViewport Script derive fails ScriptApply for aarch64 and breaks every pageflipnav android build). - map: vendor TagThreadPool (removed upstream with the task-pool scheduler) into thread_pool.rs; Walk literals gain ..Default::default() for new aspect/cell/deferred fields. Verified by pageflipnav aarch64 release rust build (0 errors).
92 lines
2.6 KiB
Rust
92 lines
2.6 KiB
Rust
// Map crate for Nigig
|
|
// Uses makepad_widgets for rendering
|
|
|
|
pub(crate) mod geometry;
|
|
pub(crate) mod label;
|
|
pub mod style;
|
|
pub(crate) mod tile;
|
|
pub(crate) mod mvt_parser;
|
|
pub(crate) mod overpass_parser;
|
|
pub(crate) mod tessellation;
|
|
pub(crate) mod tile_decode;
|
|
pub(crate) mod tile_disk;
|
|
pub mod view;
|
|
pub(crate) mod sprite;
|
|
pub(crate) mod icons;
|
|
|
|
// Latest makepad map implementation (to be integrated)
|
|
pub mod makepad_map;
|
|
|
|
#[cfg(feature = "map_style")]
|
|
pub(crate) mod style_json;
|
|
#[cfg(feature = "map_style")]
|
|
pub(crate) mod asset_loader;
|
|
|
|
pub(crate) mod viewport;
|
|
pub(crate) mod cache;
|
|
pub(crate) mod renderer;
|
|
pub mod render_graph;
|
|
pub(crate) mod scheduler;
|
|
pub(crate) mod label_state;
|
|
pub(crate) mod thread_pool;
|
|
|
|
use makepad_widgets::ScriptVm;
|
|
|
|
pub fn script_mod(vm: &mut ScriptVm) {
|
|
style::script_mod(vm); // Register MapThemeStyle and related types first
|
|
view::script_mod(vm); // Then use them in NigigMapView
|
|
}
|
|
|
|
pub use view::*;
|
|
|
|
// Phase 2: Overlay system (routes, markers, position puck)
|
|
pub mod overlay;
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn test_script_mod_does_not_panic() {
|
|
// This test ensures script_mod can be called without panicking
|
|
// We can't test the actual functionality without a full ScriptVm runtime
|
|
// but we can at least verify the function exists and is callable
|
|
use makepad_widgets::ScriptVm;
|
|
|
|
// Create a minimal ScriptVm (this may fail, which is okay for this test)
|
|
// The important thing is that script_mod is properly defined
|
|
let _ = std::panic::catch_unwind(|| {
|
|
// We can't actually create a ScriptVm without a full runtime,
|
|
// but we can verify the function signature is correct
|
|
let _fn_ptr: fn(&mut ScriptVm) = script_mod;
|
|
});
|
|
}
|
|
|
|
#[test]
|
|
fn test_module_structure() {
|
|
// Verify that all expected modules are accessible
|
|
// This is a compile-time check more than a runtime check
|
|
use crate::geometry;
|
|
use crate::label;
|
|
use crate::style;
|
|
use crate::tile;
|
|
use crate::mvt_parser;
|
|
use crate::overpass_parser;
|
|
use crate::tessellation;
|
|
use crate::tile_decode;
|
|
use crate::tile_disk;
|
|
use crate::view;
|
|
use crate::sprite;
|
|
use crate::icons;
|
|
use crate::viewport;
|
|
use crate::cache;
|
|
use crate::renderer;
|
|
use crate::render_graph;
|
|
use crate::scheduler;
|
|
use crate::label_state;
|
|
use crate::overlay;
|
|
|
|
// If we get here, all modules are accessible
|
|
assert!(true);
|
|
}
|
|
}
|