mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-29 09:52:03 +00:00
Add AppKit's NSImage names to CPImage. Resolve each system image on use against current theme and drawing appearance, so image follows theme switch and appearance. * CPAppearance.j: Add _CPThemeAttributeValueForAppearance() to return theme value for closest appearance, in best-match order, then value for every appearance. * CPColor.j: Resolve catalog colours through _CPThemeAttributeValueForAppearance(). * CPImage.j: - Add constant for each AppKit NSImageName except Touch Bar names, with CP in place of NS; keep string of CPImageNameColorPanel for existing cibs. - Add theme class image with one attribute per system image; derive attribute name from image name in kebab case (CPAddTemplate gives add-template). - Load theme attributes in each initialiser, as CPColor and CPFont do. - Add _CPSystemImage; share one instance per name, resolve image on each use, forward CPImage and subclass methods to resolved image, and repost its load notification. - Fall back from +imageNamed: to system image; take default colour panel images from AppKit resources. - Archive system image by name; decode name to shared instance. * _CPObject+Theme.j: Replace CPResponder.j import with forward declaration; break import cycle through CPCursor.j and CPImage.j. * CGContext.j: Take image element from -image in CGContextDrawImage, so system images draw. * _CPCibCustomResource.j: Resolve built-in image names to system images; remove button bar image map and its CPButtonBar and CPTheme dependencies; keep nil for CPMenuCheckmark and CPMenuMixedState. * NSCustomResource.j: Map each IB built-in image name with matching system image by prefix; alias NSColorPanel and NSToolbarShowColors to CPImageNameColorPanel; raise for unsupported names. * Aristo and Aristo2 ThemeDescriptors.j: Give add, remove and action template images as CPImage theme values; share button bar images between CPButtonBar and CPImage through ButtonBarImage functions; exclude themedImage from showcase. * Aristo3 ThemeDescriptors.j: Add A3MaskIcon() for SVG mask icons and replace inline button bar icon definitions with it; give add, remove and action template images as CPImage theme values; exclude themedImage from showcase. * CPImageNamedTest.j: Add tests for names, shared instances, defaults, theme values per appearance, theme switch, CSS and subclass forwarding, load notification, size override, archiving and cib resources.