and I’m trying to add Haiku clipboard support. However, I can’t seem to interface with be_clipboard because calling be_clipboard->Lock() or be_clipboard->Data() causes a segment violation somewhere in the internal library. According to the debugger, this really is happening in the system library itself. However, the built-in clipboard program has almost the same code yet doesn’t have this same error. Something that might be a factor is that the Clipboard project needs GCC 11 or newer to compile, so maybe the compiler is too new?
You need a BApplication in order to use be_clipboard, otherwise you need to construct the BClipboard object yourself. There are some notes about this in the BeBook
Use the baked-in alias “cb” to refer to Clipboard instead, and/or rename the main binary to something like “clipboardjh” (as the full name for branding is Clipboard by Jackson Huff)
Replace the built-in clipboard command (Would this actually be possible? It could actually be if Haiku is still in a Beta state)
How many scripts/utilities rely on the integrated clipboard command? If there aren’t many, then it may actually be a reasonable proposition to do option 2, or 1 if that isn’t possible.
I suppose Jackson Huff’s tool will have to be renamed then, if anyone plans to package it for Haiku. I doubt we’ll rename the system command that was shipped since BeOS days (IIRC).
Personally, I use Haiku’s “clipboard” command in several scripts and functions.