From 9ebbbeccd3d30f345d36a9086c4ff35b862dc2b7 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Tue, 14 Jul 2026 11:17:51 +0200 Subject: [PATCH] [Cocoa] Add generation instructions for PDF export functions The CGPDFContext* functions are all present in the CoreGraphicsFull.bridgesupport files but were never registered in the corresponding .extras files, so MacGenerator silently dropped them on the next regeneration. This adds the missing swt_gen="true" entries and reruns the MacGenerator to adopt its ordering of generated entries in the OS class. Follow-up to https://github.com/eclipse-platform/eclipse.platform.swt/pull/2882 Co-Authored-By: Claude Sonnet 5 --- .../Eclipse SWT PI/cocoa/library/os.c | 2 +- .../CoreGraphicsFull.bridgesupport.extras | 19 +++++++++++++++++++ .../org/eclipse/swt/internal/cocoa/OS.java | 16 ++++++++-------- 3 files changed, 28 insertions(+), 9 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 6a8d73e68c7..da6a5735fd7 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 @@ -1605,7 +1605,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, (const CGRect *)lparg1, (CFDictionaryRef)arg2); + rc = (jlong)CGPDFContextCreateWithURL((CFURLRef)arg0, (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/CoreGraphicsFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras index d694bac6a20..3702b5e3815 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras @@ -247,6 +247,25 @@ + + + + + + + + + + + + + + + + + + + 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 025253b0276..c1f1a1c36eb 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 @@ -3174,12 +3174,6 @@ public static Selector getSelector (long value) { * @param image cast=(CGImageRef) */ public static final native void CGImageRelease(long image); -/** - * @param url cast=(CFURLRef) - * @param mediaBox cast=(const CGRect *) - * @param auxiliaryInfo cast=(CFDictionaryRef) - */ -public static final native long CGPDFContextCreateWithURL(long url, CGRect mediaBox, long auxiliaryInfo); /** * @param context cast=(CGContextRef) * @param pageInfo cast=(CFDictionaryRef) @@ -3188,11 +3182,17 @@ public static Selector getSelector (long value) { /** * @param context cast=(CGContextRef) */ -public static final native void CGPDFContextEndPage(long context); +public static final native void CGPDFContextClose(long context); +/** + * @param url cast=(CFURLRef) + * @param mediaBox cast=(CGRect*) + * @param auxiliaryInfo cast=(CFDictionaryRef) + */ +public static final native long CGPDFContextCreateWithURL(long url, CGRect mediaBox, long auxiliaryInfo); /** * @param context cast=(CGContextRef) */ -public static final native void CGPDFContextClose(long context); +public static final native void CGPDFContextEndPage(long context); /** * @param path cast=(CGMutablePathRef) * @param m cast=(CGAffineTransform*)