AppKit: CPScreen, CPColor PLATFORM conditional removal

- CPScreen.j and CPColor.j: one PLATFORM block each, resolved to
  runtime CPDOMAvailable guards; no preprocessor directives remain
  in either file
- work-in-progress towards complete removal of CPP directives
This commit is contained in:
David Richardson committed 2026-08-21 15:52:17 -06:00
1 parent 01476c53ac
commit 159a82e077
2 files changed
+7 -7

No files matched your search

+4 -3
View File
@@ -563,9 +563,10 @@ var cachedBlackColor,
{
// Fix to avoid a problem when compiling a theme (missing the alpha component as theme compiler doesn't have CSS rgba capability)
var hasAlpha = YES;
#if PLATFORM(DOM)
hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0;
#endif
if (CPDOMAvailable)
{
hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0;
}
_cssString = (hasAlpha ? "rgba(" : "rgb(") +
parseInt(_components[0] * 255.0) + ", " +
+3 -4
View File
@@ -42,11 +42,10 @@
*/
- (CGRect)visibleFrame
{
#if PLATFORM(DOM)
return CGRectMake(window.screen.availLeft, window.screen.availTop, window.screen.availWidth, window.screen.availHeight);
#else
if (CPDOMAvailable)
return CGRectMake(window.screen.availLeft, window.screen.availTop, window.screen.availWidth, window.screen.availHeight);
return CGRectMakeZero();
#endif
}
@end