Files
David Richardson f468d483ff AppKit, Foundation: Fix view archiving and add regression tests
Keyed archiving preserves view hierarchies created in code. Decoded views
retain their content, subviews and state, and each view class is verified
against its own description before archiving.

* CPAccordionView: Add CPCoding to CPAccordionView and CPAccordionViewItem.

* CPBox:
  * Encode the content, title and box views unconditionally.
  * Clear the superviews of the box and title views during decoding.

* CPButton: Initialize the value to CPOffState.

* CPMapTable: Add CPCoding.

* CPPopUpButton: Clear the inherited button value.

* CPSearchField: Update the cancel button when the object value changes.

* CPSplitView: Return nil from dividerColor when the theme defines no divider
  image.

* CPStepper: Discard the decoded buttons before recreating them.

* CPTabView:
  * Encode the current tab view items.
  * Exclude the tabs from the encoded subviews.

* CPTokenField:
  * Discard the decoded scroll view before recreating it.
  * Add the decoded tokens to the new document view.

* CPVisualEffectView: Resolve the backdrop filter property only when a DOM is
  available.

* CPBoxTest: Verify preservation of the content view, hierarchy and title, and
  decoding of an untitled box without warnings.

* CPButtonTest: Verify the initial value of a button.

* CPMapTableTest: Verify preservation of entries through archiving.

* DropInArchiveFixtures: Add populated view fixtures, tree comparison, and
  round trip and saved archive helpers.

* DropInArchiveGenerator: Save cib descriptions and view archives, and write no
  archive data if any view fails its round trip.

* DropInArchiveTest: Verify new archives, saved archives and reference cibs, and
  treat decoding warnings as failures.

* DropInSnapshot:
  * Describe the view hierarchy through private views, with state and content.
  * Add DropInWithFixedScrollerStyle.

* DropInArchives, DropInCibs: Add saved view archives, cib descriptions and
  reference cibs.
2026-10-31 20:51:13 -06:00

11 lines
14 KiB
JSON

{
"SmartFoldersPredicateEditor.cib": [
"{\"class\":\"CPApplication\"}",
"{\"class\":\"CPWindow\",\"title\":\"Predicate Editor\",\"contentView\":{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":1,\\\"y\\\":1},\\\"size\\\":{\\\"height\\\":290,\\\"width\\\":551}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"18\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPTextField\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":63,\\\"y\\\":12},\\\"size\\\":{\\\"height\\\":29,\\\"width\\\":474}}\",\"state\":{\"acceptsFirstResponder\":\"true\",\"alignment\":\"4\",\"autoresizingMask\":\"34\",\"backgroundColor\":\"CPColor:rgba(255, 255, 255, 1)\",\"bezelStyle\":\"0\",\"controlSize\":\"0\",\"drawsBackground\":\"true\",\"isBordered\":\"false\",\"isEditable\":\"true\",\"isEnabled\":\"true\",\"isHidden\":\"false\",\"isSelectable\":\"true\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"1\",\"doubleValue\":\"0\",\"objectValue\":\"\",\"stringValue\":\"\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":29,\\\"width\\\":474}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPTextField\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":19,\\\"y\\\":18},\\\"size\\\":{\\\"height\\\":17,\\\"width\\\":41}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"4\",\"autoresizingMask\":\"36\",\"backgroundColor\":\"CPColor:rgba(175, 175, 175, 1)\",\"bezelStyle\":\"0\",\"controlSize\":\"0\",\"drawsBackground\":\"false\",\"isBordered\":\"false\",\"isEditable\":\"false\",\"isEnabled\":\"true\",\"isHidden\":\"false\",\"isSelectable\":\"false\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"1\",\"doubleValue\":\"0\",\"objectValue\":\"Name:\",\"stringValue\":\"Name:\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":17,\\\"width\\\":41}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPScrollView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":20,\\\"y\\\":55},\\\"size\\\":{\\\"height\\\":184,\\\"width\\\":512}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"18\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPClipView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":1,\\\"y\\\":1},\\\"size\\\":{\\\"height\\\":182,\\\"width\\\":510}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"8\",\"backgroundColor\":\"CPColor:rgba(232, 232, 232, 1)\",\"isHidden\":\"false\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPPredicateEditor\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":182,\\\"width\\\":510}}\",\"state\":{\"acceptsFirstResponder\":\"true\",\"alignment\":\"0\",\"autoresizingMask\":\"18\",\"backgroundColor\":\"nil\",\"controlSize\":\"0\",\"isEditable\":\"true\",\"isEnabled\":\"true\",\"isHidden\":\"false\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"nil\",\"doubleValue\":\"0\",\"objectValue\":\"nil\",\"stringValue\":\"\",\"tag\":\"0\"},\"subviews\":[]}]},{\"class\":\"CPScroller\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":-100,\\\"y\\\":269},\\\"size\\\":{\\\"height\\\":7,\\\"width\\\":360}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"0\",\"autoresizingMask\":\"8\",\"backgroundColor\":\"nil\",\"controlSize\":\"0\",\"isEnabled\":\"false\",\"isHidden\":\"true\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"1\",\"doubleValue\":\"0\",\"objectValue\":\"0\",\"stringValue\":\"0\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":7,\\\"width\\\":360}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPScroller\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":491,\\\"y\\\":110},\\\"size\\\":{\\\"height\\\":73,\\\"width\\\":7}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"0\",\"autoresizingMask\":\"8\",\"backgroundColor\":\"nil\",\"controlSize\":\"0\",\"isEnabled\":\"false\",\"isHidden\":\"true\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"1\",\"doubleValue\":\"0\",\"objectValue\":\"0\",\"stringValue\":\"0\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":73,\\\"width\\\":7}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"CPColor:rgba(255, 255, 255, 1)\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPClipView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPButton\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":481,\\\"y\\\":245},\\\"size\\\":{\\\"height\\\":25,\\\"width\\\":51}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"2\",\"autoresizingMask\":\"9\",\"backgroundColor\":\"nil\",\"bezelStyle\":\"11\",\"controlSize\":\"0\",\"isBordered\":\"true\",\"isEnabled\":\"true\",\"isHidden\":\"false\",\"lineBreakMode\":\"0\",\"verticalAlignment\":\"2\",\"doubleValue\":\"0\",\"objectValue\":\"0\",\"state\":\"0\",\"stringValue\":\"0\",\"tag\":\"1\",\"title\":\"OK\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":25,\\\"width\\\":51}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPButton\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":395,\\\"y\\\":245},\\\"size\\\":{\\\"height\\\":25,\\\"width\\\":76}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"2\",\"autoresizingMask\":\"9\",\"backgroundColor\":\"nil\",\"bezelStyle\":\"11\",\"controlSize\":\"0\",\"isBordered\":\"true\",\"isEnabled\":\"true\",\"isHidden\":\"false\",\"lineBreakMode\":\"0\",\"verticalAlignment\":\"2\",\"doubleValue\":\"0\",\"objectValue\":\"0\",\"state\":\"0\",\"stringValue\":\"0\",\"tag\":\"0\",\"title\":\"Cancel\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":25,\\\"width\\\":76}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]}]}}"
],
"TextEditorDocumentWindow.cib": [
"{\"class\":\"CPApplication\"}",
"{\"class\":\"CPWindow\",\"title\":\"Window\",\"contentView\":{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":1,\\\"y\\\":92},\\\"size\\\":{\\\"height\\\":168,\\\"width\\\":474}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"18\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPScrollView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":202,\\\"width\\\":476}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"18\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPClipView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":202,\\\"width\\\":469}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"8\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPTextView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":270,\\\"width\\\":469}}\",\"state\":{\"acceptsFirstResponder\":\"true\",\"autoresizingMask\":\"18\",\"backgroundColor\":\"CPColor:rgba(255, 255, 255, 1)\",\"isEditable\":\"true\",\"isHidden\":\"false\",\"isSelectable\":\"true\",\"objectValue\":\"CPTextStorage\",\"string\":\"\",\"stringValue\":\"\",\"tag\":\"0\"},\"subviews\":[]}]},{\"class\":\"CPScroller\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":-100,\\\"y\\\":355},\\\"size\\\":{\\\"height\\\":7,\\\"width\\\":240}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"0\",\"autoresizingMask\":\"8\",\"backgroundColor\":\"nil\",\"controlSize\":\"0\",\"isEnabled\":\"false\",\"isHidden\":\"true\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"1\",\"doubleValue\":\"0\",\"objectValue\":\"0\",\"stringValue\":\"0\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":7,\\\"width\\\":240}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPScroller\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":469,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":202,\\\"width\\\":7}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"alignment\":\"0\",\"autoresizingMask\":\"8\",\"backgroundColor\":\"nil\",\"controlSize\":\"0\",\"isEnabled\":\"true\",\"isHidden\":\"false\",\"lineBreakMode\":\"2\",\"verticalAlignment\":\"1\",\"doubleValue\":\"0\",\"objectValue\":\"0\",\"stringValue\":\"0\",\"tag\":\"0\"},\"subviews\":[{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":202,\\\"width\\\":7}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":202},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":151.1259259259259,\\\"width\\\":7}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]},{\"class\":\"CPView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"CPColor:rgba(255, 255, 255, 1)\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]},{\"class\":\"CPClipView\",\"frame\":\"{\\\"origin\\\":{\\\"x\\\":0,\\\"y\\\":0},\\\"size\\\":{\\\"height\\\":0,\\\"width\\\":0}}\",\"state\":{\"acceptsFirstResponder\":\"false\",\"autoresizingMask\":\"0\",\"backgroundColor\":\"nil\",\"isHidden\":\"false\",\"tag\":\"-1\"},\"subviews\":[]}]}]}}"
]
}