Skip to content

fontlab_glyport.ui.nib_graph

nib_graph

XIB sources and compiled NIBs as one UIGraph (R028, R031).

Both readers emit the same node schema, so a NIB with no XIB source and the XIB it came from produce equal graphs (the tests compare them):

  • source_class is the AppKit class (NSTextField); a custom class is in properties["customClass"] (GSSteppingTextField, GSPaletteView).
  • Placeholders are NSCustomObject nodes with properties["role"]: owner (File's Owner, with className), firstResponder or application; other custom objects have role object.
  • Views carry frame [x, y, w, h] in Cocoa's bottom-left coordinates, autoresizingMask (Interface Builder's default 12, top-left pinned) and hidden. Controls add the keys their class uses: title, editable, bezeled, buttonType, state, minValue, maxValue, value, items, selectedIndex, continuous, enabled, toolTip.
  • Connections: outlet (owner node -> destination, selector = property; an outlet to a control's cell points at the control), action (control -> target, selector = action), binding (control -> controller, selector = binding name, argument = key path), constraint (first item -> second item, or the first item again for a constant; selector "<attribute> <relation> <attribute>", argument "<multiplier> <constant> <priority>").
  • A tab view's items are its child NSView pages with tabLabel and tabIdentifier; text fields with a number formatter carry formatter {"minimum", "maximum"}, and a standalone formatter is an NSNumberFormatter node with the limits it sets; progress indicators carry minValue, maxValue, value and indeterminate.
  • A matrix carries rows, columns, mode, cellSize, intercellSpacing and cells: row-major button cells, each with title, buttonType, state, tag and enabled.
  • A box carries boxType, titlePosition, borderType, transparent and title ("" when no title is shown); its only child is its content view, marked contentView.
  • A scroll view carries hasVerticalScroller, hasHorizontalScroller, autohidesScrollers and a custom clipViewClass; its only child is its clip view's document view, marked documentView (the clip view and scrollers are not nodes).
  • An array controller is an NSArrayController node; each table column is also an NSTableColumn child node (index) so bindings can name it.
  • A table view carries columns (identifier, title, width, minWidth, maxWidth, editable), headerVisible, allowsMultipleSelection, rowHeight and prototypes: for a view-based table, each prototype cell view as its own graph JSON keyed by identifier (File's Owner = the makeViewWithIdentifier_owner_ owner).
  • Buttons also carry bordered and, with a named image, image and imagePosition; a switch carries state.
  • A text view carries string (plain text), editable and selectable.
  • A split view carries vertical and dividerStyle (its subviews are the panes); a grid view carries rows, columns, rowSpacing and columnSpacing (its cells' content views are its children); a visual effect view is a plain container.
  • A segmented control carries segments (label, width, selected, tag, image) and trackingMode; a search field adds placeholder and sendsSearchStringImmediately to the text field properties.
  • A combo box carries title (its text), editable, items, completes, numberOfVisibleItems and usesDataSource.
  • A path control carries url (a URL string), editable and allowedTypes.
  • An image view carries image (a resource name) and imageScaling.
  • A stack view carries orientation (0 horizontal, 1 vertical), alignment (an NSLayoutAttribute), distribution, spacing, edgeInsets [top, left, bottom, right] and detachesHiddenViews; its children (the arranged views) carry arranged.
  • A window (NSWindow or NSPanel; a custom subclass in customClass) carries title, styleMask and contentRect (screen coordinates, bottom-left); its content view is its only child, marked contentView.

Nodes keep document order (XIB) or archive order of NSSubviews (NIB). Elements the readers do not translate still become nodes (class xib:<element> or the archived class); the loader decides what is blocked.

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
DEFAULT_MASK attribute
MAX_DEPTH attribute
MAX_NODES attribute
MAX_XML_DEPTH attribute
MAX_XML_ELEMENTS attribute
graph_from_nib function (path: str | Path) -> UIGraph Translate a compiled NIB (file or bundle directory) into a <code>UIGraph</code>.
graph_from_xib function (path: str | Path) -> UIGraph Translate an Interface Builder XIB document into a <code>UIGraph</code>.
untranslated_xib function (path: str | Path) -> dict[str, int] Elements of a XIB that <code>graph&#95;from&#95;xib</code> does not translate, with counts (fonts, colours, cell behaviours, ...): the unmapped-property report.