From bf19b09ad0d9990dbea3f68dd895514a8aab76ac Mon Sep 17 00:00:00 2001 From: David Richardson Date: Tue, 6 Oct 2026 19:40:40 -0600 Subject: [PATCH] AppKit: add missed CPDOMDisplayServer.j promotion, drop its header - the promotion commit captured the consumer imports and the test update but missed the new source file itself and the deletion of the force-included header it replaces - without the .j, the display-server functions are absent from the compiled frameworks; with the .h still present, the legacy build force-includes the old macro definitions alongside the new functions - follow-up to the display-server promotion commit --- AppKit/Platform/DOM/CPDOMDisplayServer.h | 68 ----------------- AppKit/Platform/DOM/CPDOMDisplayServer.j | 96 ++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 68 deletions(-) delete mode 100644 AppKit/Platform/DOM/CPDOMDisplayServer.h create mode 100644 AppKit/Platform/DOM/CPDOMDisplayServer.j diff --git a/AppKit/Platform/DOM/CPDOMDisplayServer.h b/AppKit/Platform/DOM/CPDOMDisplayServer.h deleted file mode 100644 index b99c8ac02..000000000 --- a/AppKit/Platform/DOM/CPDOMDisplayServer.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * CPDOMDisplayServer.h - * AppKit - * - * Created by Francisco Tolmasky. - * Copyright 2008, 280 North, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define CPDOMDisplayServerSetStyleLeftTop(aDOMElement, aTransform, aLeft, aTop) \ -if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aLeft, aTop), aTransform); \ -else var ____p = CGPointMake(aLeft, aTop); \ -aDOMElement.style.left = ROUND(____p.x) + "px";\ -aDOMElement.style.top = ROUND(____p.y) + "px"; - -#define CPDOMDisplayServerSetStyleRightTop(aDOMElement, aTransform, aRight, aTop) \ -if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aRight, aTop), aTransform); \ -else var ____p = CGPointMake(aRight, aTop); \ -aDOMElement.style.right = ROUND(____p.x) + "px";\ -aDOMElement.style.top = ROUND(____p.y) + "px"; - -#define CPDOMDisplayServerSetStyleLeftBottom(aDOMElement, aTransform, aLeft, aBottom) \ -if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aLeft, aBottom), aTransform); \ -else var ____p = CGPointMake(aLeft, aBottom); \ -aDOMElement.style.left = ROUND(____p.x) + "px";\ -aDOMElement.style.bottom = ROUND(____p.y) + "px"; - -#define CPDOMDisplayServerSetStyleRightBottom(aDOMElement, aTransform, aRight, aBottom) \ -if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aRight, aBottom), aTransform); \ -else var ____p = CGPointMake(aRight, aBottom); \ -aDOMElement.style.right = ROUND(____p.x) + "px";\ -aDOMElement.style.bottom = ROUND(____p.y) + "px"; - -#define CPDOMDisplayServerSetStyleSize(aDOMElement, aWidth, aHeight) \ - aDOMElement.style.width = MAX(0.0, ROUND(aWidth)) + "px";\ - aDOMElement.style.height = MAX(0.0, ROUND(aHeight)) + "px"; - -#define CPDOMDisplayServerSetSize(aDOMElement, aWidth, aHeight) \ - aDOMElement.width = MAX(0.0, ROUND(aWidth));\ - aDOMElement.height = MAX(0.0, ROUND(aHeight)); - -#define CPDOMDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\ - aDOMElement.style.backgroundSize = aWidth + ' ' + aHeight; - -#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement) \ - aParentElement.appendChild(aChildElement); - -#define CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement) \ - aParentElement.insertBefore(aChildElement, aBeforeElement); - -#define CPDOMDisplayServerRemoveChild(aParentElement, aChildElement) \ - aParentElement.removeChild(aChildElement); - -#define PREPARE_DOM_OPTIMIZATION() -#define EXECUTE_DOM_INSTRUCTIONS() diff --git a/AppKit/Platform/DOM/CPDOMDisplayServer.j b/AppKit/Platform/DOM/CPDOMDisplayServer.j new file mode 100644 index 000000000..71f98ba74 --- /dev/null +++ b/AppKit/Platform/DOM/CPDOMDisplayServer.j @@ -0,0 +1,96 @@ +/* + * CPDOMDisplayServer.j + * AppKit + * + * Created by Francisco Tolmasky. + * Copyright 2008, 280 North, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* Formerly a force-included header of function-like macros; promoted to a + real source file for the preprocessor-free build. */ + +function CPDOMDisplayServerSetStyleLeftTop(aDOMElement, aTransform, aLeft, aTop) +{ + if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aLeft, aTop), aTransform); + else var ____p = CGPointMake(aLeft, aTop); + aDOMElement.style.left = ROUND(____p.x) + "px"; + aDOMElement.style.top = ROUND(____p.y) + "px"; +} + +function CPDOMDisplayServerSetStyleRightTop(aDOMElement, aTransform, aRight, aTop) +{ + if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aRight, aTop), aTransform); + else var ____p = CGPointMake(aRight, aTop); + aDOMElement.style.right = ROUND(____p.x) + "px"; + aDOMElement.style.top = ROUND(____p.y) + "px"; +} + +function CPDOMDisplayServerSetStyleLeftBottom(aDOMElement, aTransform, aLeft, aBottom) +{ + if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aLeft, aBottom), aTransform); + else var ____p = CGPointMake(aLeft, aBottom); + aDOMElement.style.left = ROUND(____p.x) + "px"; + aDOMElement.style.bottom = ROUND(____p.y) + "px"; +} + +function CPDOMDisplayServerSetStyleRightBottom(aDOMElement, aTransform, aRight, aBottom) +{ + if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aRight, aBottom), aTransform); + else var ____p = CGPointMake(aRight, aBottom); + aDOMElement.style.right = ROUND(____p.x) + "px"; + aDOMElement.style.bottom = ROUND(____p.y) + "px"; +} + +function CPDOMDisplayServerSetStyleSize(aDOMElement, aWidth, aHeight) +{ + aDOMElement.style.width = MAX(0.0, ROUND(aWidth)) + "px"; + aDOMElement.style.height = MAX(0.0, ROUND(aHeight)) + "px"; +} + +function CPDOMDisplayServerSetSize(aDOMElement, aWidth, aHeight) +{ + aDOMElement.width = MAX(0.0, ROUND(aWidth)); + aDOMElement.height = MAX(0.0, ROUND(aHeight)); +} + +function CPDOMDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight) +{ + aDOMElement.style.backgroundSize = aWidth + ' ' + aHeight; +} + +function CPDOMDisplayServerAppendChild(aParentElement, aChildElement) +{ + aParentElement.appendChild(aChildElement); +} + +function CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement) +{ + aParentElement.insertBefore(aChildElement, aBeforeElement); +} + +function CPDOMDisplayServerRemoveChild(aParentElement, aChildElement) +{ + aParentElement.removeChild(aChildElement); +} + +function PREPARE_DOM_OPTIMIZATION() +{ +} + +function EXECUTE_DOM_INSTRUCTIONS() +{ +}