mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge branch 'processing:main' into main-gradle
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
// #include <jni.h>
|
||||
// #import <JavaNativeFoundation/JavaNativeFoundation.h>
|
||||
#include <jni.h>
|
||||
|
||||
JNIEXPORT void JNICALL Java_processing_core_ThinkDifferent_hideMenuBar
|
||||
(JNIEnv *env, jclass clazz, jboolean visible, jboolean kioskMode)
|
||||
@@ -24,3 +24,10 @@ JNIEXPORT void JNICALL Java_processing_core_ThinkDifferent_activateIgnoringOther
|
||||
{
|
||||
[NSApp activateIgnoringOtherApps:true];
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL Java_processing_core_ThinkDifferent_activate
|
||||
(JNIEnv *env, jclass klass)
|
||||
{
|
||||
[NSApp activate];
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -740,7 +740,7 @@ public class PFont implements PConstants {
|
||||
// six element array received from the Java2D path iterator
|
||||
float[] iterPoints = new float[6];
|
||||
// array passed to createGlyphVector
|
||||
char[] textArray = new char[] { ch };
|
||||
char[] textArray = { ch };
|
||||
|
||||
//Graphics2D graphics = (Graphics2D) this.getGraphics();
|
||||
//FontRenderContext frc = graphics.getFontRenderContext();
|
||||
@@ -755,16 +755,17 @@ public class PFont implements PConstants {
|
||||
shp.getPathIterator(null, detail); // convert to line segments
|
||||
|
||||
int contours = 0;
|
||||
s.beginShape();
|
||||
s.noStroke();
|
||||
s.fill(0);
|
||||
while (!iter.isDone()) {
|
||||
int type = iter.currentSegment(iterPoints);
|
||||
switch (type) {
|
||||
case PathIterator.SEG_MOVETO: // 1 point (2 vars) in textPoints
|
||||
if (contours == 0) {
|
||||
s.beginShape();
|
||||
} else {
|
||||
if (contours > 0) {
|
||||
s.beginContour();
|
||||
}
|
||||
contours++;
|
||||
++contours;
|
||||
s.vertex(iterPoints[0], iterPoints[1]);
|
||||
break;
|
||||
|
||||
|
||||
@@ -124,9 +124,33 @@ public class ThinkDifferent {
|
||||
|
||||
static native public void showMenuBar();
|
||||
|
||||
// Used by Python (Jython) Mode to bring windows to the front
|
||||
// deprecated
|
||||
// https://developer.apple.com/documentation/appkit/nsapplication/activate(ignoringotherapps:)
|
||||
static native public void activateIgnoringOtherApps();
|
||||
|
||||
// added in macOS 14 (Sonoma)
|
||||
// https://developer.apple.com/documentation/appkit/nsapplication/activate()
|
||||
static native public void activate();
|
||||
|
||||
// Used by py5 to bring Sketch to the front
|
||||
static public boolean activateSketchWindow() {
|
||||
try {
|
||||
String osVersion = System.getProperty("os.version");
|
||||
int versionNumber = Integer.parseInt(osVersion.split("\\.")[0]);
|
||||
|
||||
if (versionNumber >= 14) {
|
||||
activate();
|
||||
return true;
|
||||
} else if (versionNumber >= 10) {
|
||||
activateIgnoringOtherApps();
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static {
|
||||
final String NATIVE_FILENAME = "libDifferent.jnilib";
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user