Regression tests and their supporting framework fixes are incorporated.
Remaining test failures identify Aristo3 defects.
Conflict resolutions:
* CPButtonBar: Retain Aristo3 decoding and observe the hidden state of decoded buttons.
* CPPopUpButton: Retain the Aristo3 bezel style and clear the inherited button value.
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.
If the bezel state was changed and some attribute was set like an "image". The image would not be found as there were two states active and it would not match.
Previously with the CPRoundRectBezelStyle we got a CPNull themeState. Now we get an instance of ThemeState with the theme CPButtonStateBezelStyleRoundRect. CPButtonStateBezelStyleRoundRect is equal to CPThemeState("roundRect").
Previously, Cappuccino was using preprocessor macros internally for the CGPoint/Size/Rect/Inset/Affine functions, as well as for CPRange. These macros had the same name as the corresponding function, but began with _. The functions were actually defined using the macros.
The motivation behind using macros was to increase performance by reducing function calls. However, there were a number of problems with this approach:
- There was an artificial dichotomy between _CG macros and the corresponding CG functions. We never completely replaced CG function calls with _CG macros. In fact, they were often mixed up in the same file. There was an extra burden on the programmer to remember to use the macro instead of the function.
- If a method call was passed as an argument to a macro, performance could actually be significantly *worse* than a function call. For example, _CGGetRectMakeCopy([view frame]) would expand to `{ origin:{ x:[view frame].origin.x, y:[view frame].origin.y }, size:{ width:[view frame].size.width, height:[view frame].size.height } }`. So instead of a single objj_msgSend and a single simple function call, we ended up with 4 objj_msgSend calls, which are way more expensive than simple function calls.
- Because of this expansion problem, to use macros efficiently required us to remember to use variables for all macro parameters. This didn't happen, and shouldn't have to happen.
- Finally, with modern Javascript engines, function call overhead is so small that it really isn't worth using the macros.
This commit eliminates the _CGGeometry, CGAffineTransformation and CPRange macros and replaces them with function calls.
BREAKING CHANGE:
The macros are no longer available. They could only be used with compiled code, but if there is any user code that used them, they will have to be replaced with the corresponding functions.
- CPView and subclasses support multiple-value hidden bindings.
- CPControl and subclasses support multiple-value enabled bindings.
- CPWindow and CPBox support multiple-value title with pattern bindings.
- CPButton supports multiple argument + target bindings.
- CPImageView and CPTextField support multiple-value editable bindings.
- CPMenuItem supports multiple-value enabled bindings.
- Fixed bugs in CPObjectController with simple collection operators.
- CPColorWell uses black as the placeholder color.
- Runtime object attributes from a cib are applied as they are read, not deferred.
- NSNumberFormatter now reads the number style from the xib.
- Normalized some parameter names.
- Formatting.
- Test app for all binding types.
- _CPImageAndTextView adds extra pixels to allow for fractional pixels in -sizeToFit.
- NSButton now allows buttons that are not fixed height, if the theme allows it.
- Documented the mapping between bezel style constants and their IB style names.
When higlightsBy == CPNoCellMask and showsStateBy == CPChangeBackgroundCellMask
higlighted status must be preserved when a user switch state from Off to On.