Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
6 changes: 6 additions & 0 deletions build_gtk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cd /home/runner/work/eclipse.platform.swt/eclipse.platform.swt/bundles/org.eclipse.swt && java -Dws=gtk -Darch=x86_64 build-scripts/CollectSources.java -nativeSources '/home/runner/build/gtk'
cd /home/runner/build/gtk && SWT_JAVA_HOME=/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10/x64 MODEL=x86_64 OUTPUT_DIR=/home/runner/build/tmp ./build.sh install clean
cd /home/runner/work/eclipse.platform.swt/eclipse.platform.swt
cd /home/runner/work/eclipse.platform.swt/eclipse.platform.swt/bundles/org.eclipse.swt && java -Dws=gtk -Darch=x86_64 build-scripts/CollectSources.java -nativeSources '/home/runner/build/gtk'
cd /home/runner/build/gtk && SWT_JAVA_HOME=/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10/x64 MODEL=x86_64 OUTPUT_DIR=/home/runner/build/tmp ./build.sh install clean
cd /home/runner/work/eclipse.platform.swt/eclipse.platform.swt
24 changes: 24 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,3 +1471,27 @@ JNIEXPORT void JNICALL Cairo_NATIVE(memmove___3DJJ)
}
#endif

#ifndef NO_cairo_1pdf_1surface_1create
JNIEXPORT jlong JNICALL Cairo_NATIVE(cairo_1pdf_1surface_1create)
(JNIEnv *env, jclass that, jbyteArray arg0, jdouble arg1, jdouble arg2)
{
jbyte *lparg0=NULL;
jlong rc = 0;
Cairo_NATIVE_ENTER(env, that, cairo_1pdf_1surface_1create_FUNC);
if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
/*
rc = (jlong)cairo_pdf_surface_create((const char *)lparg0, arg1, arg2);
*/
{
Cairo_LOAD_FUNCTION(fp, cairo_pdf_surface_create)
if (fp) {
rc = (jlong)((cairo_surface_t * (CALLING_CONVENTION*)(const char *, jdouble, jdouble))fp)((const char *)lparg0, arg1, arg2);
}
}
fail:
if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
Cairo_NATIVE_EXIT(env, that, cairo_1pdf_1surface_1create_FUNC);
return rc;
}
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define cairo_ps_surface_set_size_LIB LIB_CAIRO
#define cairo_surface_set_device_scale_LIB LIB_CAIRO
#define cairo_surface_get_device_scale_LIB LIB_CAIRO
#define cairo_pdf_surface_create_LIB LIB_CAIRO

#ifdef CAIRO_HAS_XLIB_SURFACE
#define cairo_xlib_surface_get_height_LIB LIB_CAIRO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ typedef enum {
cairo_1pattern_1set_1filter_FUNC,
cairo_1pattern_1set_1matrix_FUNC,
cairo_1pdf_1surface_1set_1size_FUNC,
cairo_1pdf_1surface_1create_FUNC,
cairo_1pop_1group_1to_1source_FUNC,
cairo_1ps_1surface_1set_1size_FUNC,
cairo_1push_1group_FUNC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,13 @@ public class Cairo extends Platform {
*/
public static final native void memmove(double[] dest, long src, long size);

/** Surface type constant for SVG */
public static final int CAIRO_SURFACE_TYPE_SVG = 4;

/**
* @method flags=dynamic
* @param filename cast=(const char *)
*/
public static final native long cairo_pdf_surface_create(byte[] filename, double width_in_points, double height_in_points);

}
46 changes: 46 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,52 @@ JNIEXPORT void JNICALL OS_NATIVE(CGImageRelease)
}
#endif

#ifndef NO_CGPDFContextCreateWithURL
JNIEXPORT jlong JNICALL OS_NATIVE(CGPDFContextCreateWithURL)
(JNIEnv *env, jclass that, jlong arg0, jobject arg1, jlong arg2)
{
CGRect _arg1, *lparg1=NULL;
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);
fail:
if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, CGPDFContextCreateWithURL_FUNC);
return rc;
}
#endif

#ifndef NO_CGPDFContextBeginPage
JNIEXPORT void JNICALL OS_NATIVE(CGPDFContextBeginPage)
(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
{
OS_NATIVE_ENTER(env, that, CGPDFContextBeginPage_FUNC);
CGPDFContextBeginPage((CGContextRef)arg0, (CFDictionaryRef)arg1);
OS_NATIVE_EXIT(env, that, CGPDFContextBeginPage_FUNC);
}
#endif

#ifndef NO_CGPDFContextEndPage
JNIEXPORT void JNICALL OS_NATIVE(CGPDFContextEndPage)
(JNIEnv *env, jclass that, jlong arg0)
{
OS_NATIVE_ENTER(env, that, CGPDFContextEndPage_FUNC);
CGPDFContextEndPage((CGContextRef)arg0);
OS_NATIVE_EXIT(env, that, CGPDFContextEndPage_FUNC);
}
#endif

#ifndef NO_CGPDFContextClose
JNIEXPORT void JNICALL OS_NATIVE(CGPDFContextClose)
(JNIEnv *env, jclass that, jlong arg0)
{
OS_NATIVE_ENTER(env, that, CGPDFContextClose_FUNC);
CGPDFContextClose((CGContextRef)arg0);
OS_NATIVE_EXIT(env, that, CGPDFContextClose_FUNC);
}
#endif

#ifndef NO_CGPathAddCurveToPoint
JNIEXPORT void JNICALL OS_NATIVE(CGPathAddCurveToPoint)
(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5, jdouble arg6, jdouble arg7)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ typedef enum {
CGImageGetHeight_FUNC,
CGImageGetWidth_FUNC,
CGImageRelease_FUNC,
CGPDFContextCreateWithURL_FUNC,
CGPDFContextBeginPage_FUNC,
CGPDFContextEndPage_FUNC,
CGPDFContextClose_FUNC,
CGPathAddCurveToPoint_FUNC,
CGPathAddLineToPoint_FUNC,
CGPathApply_FUNC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3198,6 +3198,25 @@ public static Selector getSelector (long value) {
* @param image cast=(CGImageRef)
*/
public static final native void CGImageRelease(long image);
/**
* @param url cast=(CFURLRef)
* @param mediaBox flags=struct
* @param auxiliaryInfo cast=(CFDictionaryRef)
*/
public static final native long CGPDFContextCreateWithURL(long url, CGRect mediaBox, long auxiliaryInfo);
/**
* @param context cast=(CGContextRef)
* @param pageInfo cast=(CFDictionaryRef)
*/
public static final native void CGPDFContextBeginPage(long context, long pageInfo);
/**
* @param context cast=(CGContextRef)
*/
public static final native void CGPDFContextEndPage(long context);
/**
* @param context cast=(CGContextRef)
*/
public static final native void CGPDFContextClose(long context);
/**
* @param path cast=(CGMutablePathRef)
* @param m cast=(CGAffineTransform*)
Expand Down
Loading