diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-26 11:59:53 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-26 11:59:53 +0200 |
| commit | 66d8f4569a9f13270c5f477e0730f127a22333e2 (patch) | |
| tree | ebb60254e69d7f65ec2245aeae3543f6efff0cbb /src/lib.rs | |
| parent | 99cb655832161d4ebec73273a15453a8f6acc1b7 (diff) | |
Locate me!
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -61,7 +61,7 @@ use crate::font::FontStore; use crate::frame::Frame; use crate::image::ImageStore; use crate::loading::Loader; -use crate::model::StyleMap; +use crate::model::{PinBoard, StyleMap}; use crate::source::{SourceId, SourceStore}; /// Typeset a source file into a collection of layouted frames. @@ -76,27 +76,30 @@ pub fn typeset(ctx: &mut Context, id: SourceId) -> TypResult<Vec<Arc<Frame>>> { /// The core context which holds the configuration and stores. pub struct Context { - /// The context's configuration. - pub config: Config, /// Stores loaded source files. pub sources: SourceStore, /// Stores parsed font faces. pub fonts: FontStore, /// Stores decoded images. pub images: ImageStore, + /// The context's configuration. + config: Config, /// Stores evaluated modules. - pub modules: HashMap<SourceId, Module>, + modules: HashMap<SourceId, Module>, + /// Stores document pins. + pins: PinBoard, } impl Context { /// Create a new context. pub fn new(loader: Arc<dyn Loader>, config: Config) -> Self { Self { - config, sources: SourceStore::new(Arc::clone(&loader)), fonts: FontStore::new(Arc::clone(&loader)), images: ImageStore::new(loader), + config, modules: HashMap::new(), + pins: PinBoard::new(), } } } |
