mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Removed core dependency from the pre-processor
This commit is contained in:
@@ -23,8 +23,6 @@ sourceSets{
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
implementation(project(":core"))
|
|
||||||
|
|
||||||
implementation(libs.antlr)
|
implementation(libs.antlr)
|
||||||
implementation(libs.eclipseJDT)
|
implementation(libs.eclipseJDT)
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import org.antlr.v4.runtime.tree.ParseTree;
|
|||||||
|
|
||||||
import processing.app.Base;
|
import processing.app.Base;
|
||||||
import processing.app.Preferences;
|
import processing.app.Preferences;
|
||||||
import processing.core.PApplet;
|
|
||||||
import processing.mode.java.preproc.PdePreprocessor.Mode;
|
import processing.mode.java.preproc.PdePreprocessor.Mode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1237,16 +1236,16 @@ public class PdeParseTreeListener extends ProcessingBaseListener {
|
|||||||
boolean shouldFullScreen = Preferences.getBoolean("export.application.present");
|
boolean shouldFullScreen = Preferences.getBoolean("export.application.present");
|
||||||
shouldFullScreen = shouldFullScreen || Preferences.getBoolean("export.application.fullscreen");
|
shouldFullScreen = shouldFullScreen || Preferences.getBoolean("export.application.fullscreen");
|
||||||
if (shouldFullScreen) {
|
if (shouldFullScreen) {
|
||||||
argsJoiner.add("\"" + PApplet.ARGS_FULL_SCREEN + "\"");
|
argsJoiner.add("\"--full-screen\"");
|
||||||
|
|
||||||
String bgColor = Preferences.get("run.present.bgcolor");
|
String bgColor = Preferences.get("run.present.bgcolor");
|
||||||
argsJoiner.add("\"" + PApplet.ARGS_BGCOLOR + "=" + bgColor + "\"");
|
argsJoiner.add("\"--bgcolor=" + bgColor + "\"");
|
||||||
|
|
||||||
if (Preferences.getBoolean("export.application.stop")) {
|
if (Preferences.getBoolean("export.application.stop")) {
|
||||||
String stopColor = Preferences.get("run.present.stop.color");
|
String stopColor = Preferences.get("run.present.stop.color");
|
||||||
argsJoiner.add("\"" + PApplet.ARGS_STOP_COLOR + "=" + stopColor + "\"");
|
argsJoiner.add("\"--stop-color=" + stopColor + "\"");
|
||||||
} else {
|
} else {
|
||||||
argsJoiner.add("\"" + PApplet.ARGS_HIDE_STOP + "\"");
|
argsJoiner.add("\"--hide-stop\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import java.util.List;
|
|||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import processing.core.PApplet;
|
|
||||||
|
|
||||||
|
|
||||||
public class TextTransform {
|
public class TextTransform {
|
||||||
|
|
||||||
@@ -256,7 +254,7 @@ public class TextTransform {
|
|||||||
i = -(i + 1);
|
i = -(i + 1);
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
i = PApplet.constrain(i, 0, outMap.size()-1);
|
i = constrain(i, 0, outMap.size()-1);
|
||||||
Edit edit = outMap.get(i);
|
Edit edit = outMap.get(i);
|
||||||
int diff = outputOffset - edit.toOffset;
|
int diff = outputOffset - edit.toOffset;
|
||||||
return edit.fromOffset + Math.min(diff, Math.max(0, edit.fromLength - 1));
|
return edit.fromOffset + Math.min(diff, Math.max(0, edit.fromLength - 1));
|
||||||
@@ -271,7 +269,7 @@ public class TextTransform {
|
|||||||
i = -(i + 1);
|
i = -(i + 1);
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
i = PApplet.constrain(i, 0, inMap.size()-1);
|
i = constrain(i, 0, inMap.size()-1);
|
||||||
Edit edit = inMap.get(i);
|
Edit edit = inMap.get(i);
|
||||||
int diff = inputOffset - edit.fromOffset;
|
int diff = inputOffset - edit.fromOffset;
|
||||||
return edit.toOffset + Math.min(diff, Math.max(0, edit.toLength - 1));
|
return edit.toOffset + Math.min(diff, Math.max(0, edit.toLength - 1));
|
||||||
@@ -283,6 +281,10 @@ public class TextTransform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public final int constrain(int amt, int low, int high) {
|
||||||
|
return (amt < low) ? low : ((amt > high) ? high : amt);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class CompositeOffsetMapper implements OffsetMapper {
|
private static class CompositeOffsetMapper implements OffsetMapper {
|
||||||
private List<OffsetMapper> mappers = new ArrayList<>();
|
private List<OffsetMapper> mappers = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user