Repository navigation
Add an AWT toolkit and a sound mixer for Haiku - #61
duncanmcqueen wants to merge 5 commits into
Conversation
Haiku has inet_pton(), the other socket functions and h_errno in libnetwork. Without it, the JNI libraries fail to load (undefined __h_errno) and configure does not find the socket functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
Haiku does not define IFF_RUNNING. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
On Haiku, gethostbyname_r() is in libnetwork but no header declares it, so configure finds the function but not the number of arguments, and cpnet.c stops with #error. Use gethostbyname() in that case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
gnu.java.awt.peer.haiku is an AWT toolkit for Haiku. Windows, menus, file panels, cursors, the clipboard, drag and drop, printing (through the print server) and input methods are native Haiku parts. The other widgets use the Swing peers. Haiku's font engine measures and draws the text. gnu.javax.sound.sampled.haiku is a javax.sound.sampled mixer with Clip and SourceDataLine lines that play through the Haiku media server. Both use libhaikupeer (native/jni/haiku-peer, -lbe -ltracker -lmedia -ltranslation). configure --enable-haiku-peer builds them; it is on by default when the host is Haiku, and it then makes HaikuToolkit the default toolkit and registers the mixer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
d72cc6c to
683fa42
Compare
|
I added a commit: Haiku peer: draw shapes and images with native code. On Kaffe's interpreter, per-pixel Java code is very slow. The new file Measured on Haiku with Kaffe (microseconds per operation, before / after):
The full build passes 🤖 Generated with Claude Code |
On Kaffe's interpreter, per-pixel Java code is very slow. Draw the common cases natively, directly in the int[] pixels of the image: rectangles, 1-pixel lines, any path (curves flattened, both winding rules, with or without anti-aliasing), thin outlines as 1-pixel lines, solid colours and linear gradients, images through any affine transform (nearest neighbour or bilinear), and copyArea. Other cases (clips that are not rectangles, texture paints, other composite rules) use the Java code of AbstractGraphics2D as before. Measured on Kaffe (microseconds per operation, before / after): fillRect 100x100 1065 / 30, fillOval 7350 / 650, line of width 4 42100 / 310, gradient fill 160600 / 250, translucent image 16730 / 170, scaled image 327720 / 580, rotated image 2965950 / 200, copyArea 207620 / 60. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
9dcd155 to
f85bf0c
Compare
Summary
This pull request adds an AWT toolkit and a sound mixer for Haiku. It needs the Haiku host fixes #73, #74 and #75 (they replace #60); please merge those first. This branch still contains the old commits of #60; I will rebase it when those pull requests are merged.
gnu.java.awt.peer.swing). Haiku's font engine measures and draws the text, so the text looks like the text of other Haiku applications.javax.sound.sampledmixer. It hasClipandSourceDataLinelines that play through the Haiku media server.libhaikupeer(C++, links with-lbe -ltracker -lmedia -ltranslation).include/Makefile.ammakes its JNI headers.--enable-haiku-peer. It is on by default when the host is Haiku. ThenHaikuToolkitis the default toolkit and the Haiku mixer is in theMixerProviderlist. On other hosts nothing changes.Some parts work fully only with the fixes in the related pull requests: drag and drop (#69, #70, #71, #72),
Frame.setState()(#66),PrinterJob(#67),canDisplay()(#68), and the build fixes (#62, #63, #64). With Kaffe, theThreadfix in #65 is necessary for any program to start (Kaffe makes the mainThreadobject without a constructor).Tests
On Haiku R1/beta6 x86_64 with Kaffe 1.1.10 (interpreter): AWT widget tests, Swing, the JDK 1.0/1.1 demo applets, the clipboard in both directions with other applications, drag and drop with the file manager and a text editor, printing to the Haiku "Preview" printer, simulated input method sessions, sound clips and streams (timing checked), and modal dialogs. I built this branch alone on Haiku; it builds. I tested the programs above with all five pull requests together.
The project page has screenshots: https://duncanmcqueen.github.io/bekaffe/
AI assistance
An AI model (Claude Code, by Anthropic) wrote these changes and this text. The repository owner directed the work. Please review the changes as you review other contributions.
The commits do not have a
Signed-off-byline. If you need one, the owner will add it.🤖 Generated with Claude Code