JFLib

diagram_io/src/windows.rs#

Source: lib/diagram_io/src/windows.rs

windows -- the drawing window of a document's windows part (DF-10): the page it shows, the
zoom, the centre and what is shown, so that a file opens as it was saved

  windows::drawing_window(&doc) -> Option<DrawingWindow>    the first window of type Drawing
  windows::set_drawing_window(&mut doc, &w)   that window replaced by `w` (its ID and state
                               kept), added before the others when there is none, a part of
                               its own when the document has none; the other windows (stencils,
                               panes) stay as written
  DrawingWindow { page, view_scale, center, show_* }   None: not written / not in the file

ViewScale is the zoom (1 = 100 %); Visio writes -1 for "whole page" and -2 for "page width".
ViewCenterX/Y are the point in the window's middle, in inches from the page's lower left
corner.  The stencil windows are template.rs's (stencil_windows, set_stencil_windows).
  • struct DrawingWindow what the drawing window shows

    • page: Option<u32> -- the page's ID (Page)
    • view_scale: Option<f64> -- the zoom, 1 = 100 %; -1 the whole page, -2 the page's width (ViewScale)
    • center: Option<(f64, f64)> -- the point in the window's middle, inches from the page's lower left corner
    • show_rulers: Option<bool> -- ShowRulers
    • show_grid: Option<bool> -- ShowGrid
    • show_page_breaks: Option<bool> -- ShowPageBreaks
    • show_guides: Option<bool> -- ShowGuides
    • show_connection_points: Option<bool> -- ShowConnectionPoints
  • fn drawing_window(doc: &Document) -> Option<DrawingWindow> the document's drawing window (the first window of type Drawing), None without one

  • fn set_drawing_window(doc: &mut Document, w: &DrawingWindow) make the document's drawing window w (see the module comment)

Source: docs/API.md in the JFLib repository.