From c0934a596a9fd1ede9ef1242a5494a164af9dccb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 14 Dec 2025 11:36:42 +0000 Subject: [PATCH 1/2] Initial plan From 94e69debda7581737a09c5f1a59763714fcdf9fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 14 Dec 2025 11:49:16 +0000 Subject: [PATCH 2/2] Fix CGPDFContextCreateWithURL JNI binding for macOS Changed the mediaBox parameter from 'flags=struct' to 'cast=(const CGRect *)' in OS.java and updated the corresponding os.c generated code to pass lparg1 as a pointer instead of dereferencing it. This fixes the compilation error on macOS where the API expects a pointer to CGRect, not the struct itself. Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com> --- bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c | 2 +- .../Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c index a6aa6338a0a..b29812ac759 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c @@ -1621,7 +1621,7 @@ JNIEXPORT jlong JNICALL OS_NATIVE(CGPDFContextCreateWithURL) jlong rc = 0; OS_NATIVE_ENTER(env, that, CGPDFContextCreateWithURL_FUNC); if (arg1) if ((lparg1 = getCGRectFields(env, arg1, &_arg1)) == NULL) goto fail; - rc = (jlong)CGPDFContextCreateWithURL((CFURLRef)arg0, *lparg1, (CFDictionaryRef)arg2); + rc = (jlong)CGPDFContextCreateWithURL((CFURLRef)arg0, (const CGRect *)lparg1, (CFDictionaryRef)arg2); fail: if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1); OS_NATIVE_EXIT(env, that, CGPDFContextCreateWithURL_FUNC); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index d5c87d68bf7..fffa4837edc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -3200,7 +3200,7 @@ public static Selector getSelector (long value) { public static final native void CGImageRelease(long image); /** * @param url cast=(CFURLRef) - * @param mediaBox flags=struct + * @param mediaBox cast=(const CGRect *) * @param auxiliaryInfo cast=(CFDictionaryRef) */ public static final native long CGPDFContextCreateWithURL(long url, CGRect mediaBox, long auxiliaryInfo);