docs: Gtk2 JavaFX-backed implementation plan#655
Merged
Conversation
Add dev/modules/gtk2.md describing a four-phase plan to support `./jcpan -t Gtk2` using a JavaFX shim instead of native GTK2 bindings. Key design decisions documented: - JavaFX (Maven Central org.openjfx) as backend instead of FFM/libgtk2 - Event loop threading model: Perl main thread + JavaFX Application Thread communicate via CompletableFuture + callback drain queue - Synchronous widget dispatch via runOnFXThread() helper - GLib signal -> JavaFX event handler mapping - Headless CI support via Monocle (-Dglass.platform=Monocle) - Widget/JavaFX mapping table for ~40 widget types - ~80-function Phase 1 scope covering core widgets - 4-phase roadmap up to full upstream test suite parity - build.gradle changes: org.openjfx.javafxplugin + javafx.controls/graphics/base - Minimal Glib.pm stub required as prerequisite Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Three issues corrected in the Gtk2 JavaFX plan: 1. Apple Silicon classifier: replace bare "mac" with conditional "mac-aarch64" for aarch64 (M1/M2/M3) vs "mac" for Intel. The javafxplugin detects this automatically; the manual snippet now includes the os.arch check. 2. shadowJar conflict: JavaFX JPMS modules cannot be merged into a fat JAR (duplicate module-info.class, broken native-lib extraction). Switch to compileOnly + separate javafxRuntime configuration that copies JARs to lib/javafx/ at build time. Add jperl-gtk / jperl-gtk.bat wrapper scripts that add --module-path lib/javafx at launch. 3. Linux runtime dependencies: document that the JavaFX GTK3 native peer requires libgtk-3.so / libpango / libfreetype / libXtst at runtime on Linux. Server deployments without these should fall back to Monocle headless; Gtk2.java must catch UnsatisfiedLinkError and degrade gracefully. Also replace the already-answered "shadowJar size" and "macOS Quartz vs Monocle" open questions with the remaining real open questions: jperl auto-reexec, jcpan distroprefs for Gtk2, and Linux graceful degradation on missing system libs. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
dev/modules/gtk2.md— a detailed implementation plan for supporting./jcpan -t Gtk2on PerlOnJava using a JavaFX-backed shim instead ofnative GTK2 C bindings.
Key decisions
org.openjfx:javafx-*:21from Maven Central), followingthe same pattern as XML::Parser (Java SAX replaces libexpat) and GD (Java AWT
replaces libgd). No GTK2 system installation required.
via
CompletableFuture+ a callback drain queue.Gtk2->main()drains Perlcallbacks while blocking; all FX operations go through
runOnFXThread().-Dglass.platform=Monocle) enables test runswithout a display server.
CheckButton, ComboBox, VBox/HBox), event loop, signals
t/test suite parityGlib.pmstub documented as prerequisite.org.openjfx.javafxplugin+javafx.controls/graphics/base.Files changed
dev/modules/gtk2.md(new, 827 lines)Test plan
makepasses (doc-only commit)Generated with Devin