Initial commit: Chatter — assistive-writing app for reMarkable Paper Pro Move
Direct-framebuffer ink pipeline (stock-quality strokes), finger-wipe erase, growable scrolling canvas with color-ghost cleanup, bidirectional toggle with a persistent 4-finger return launcher, instant button feedback. Includes prebuilt aarch64 binaries (dist/), build/deploy/install scripts, a user guide, and a complete technical reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
35
tools/setbufshim.cpp
Normal file
35
tools/setbufshim.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// Feasibility check: can we intercept EPFramebuffer::setBuffers to capture the
|
||||
// framebuffer's backing QImages? setBuffers is called from the epaper platform
|
||||
// plugin (libepaper) into libqsgepaper — a cross-DSO call, so unlike swapBuffers
|
||||
// it should be interposable via LD_PRELOAD. If this fires and reports real image
|
||||
// dimensions + a pixel pointer, the direct-framebuffer ink pipeline is viable.
|
||||
//
|
||||
// ABI: std::tuple<QImage,QImage> is non-trivially-copyable, so it's passed by
|
||||
// reference (a pointer); QImage* is a pointer. So three pointer args after this.
|
||||
|
||||
#include <QImage>
|
||||
#include <tuple>
|
||||
#include <dlfcn.h>
|
||||
#include <cstdio>
|
||||
|
||||
extern "C" void _ZN13EPFramebuffer10setBuffersESt5tupleIJ6QImageS1_EEPS1_(
|
||||
void *self, void *tuplePtr, void *imgPtr)
|
||||
{
|
||||
static void (*real)(void *, void *, void *) = nullptr;
|
||||
if (!real)
|
||||
real = (void (*)(void *, void *, void *))dlsym(
|
||||
RTLD_NEXT, "_ZN13EPFramebuffer10setBuffersESt5tupleIJ6QImageS1_EEPS1_");
|
||||
|
||||
auto *t = reinterpret_cast<std::tuple<QImage, QImage> *>(tuplePtr);
|
||||
QImage *c = reinterpret_cast<QImage *>(imgPtr);
|
||||
const QImage &a = std::get<0>(*t);
|
||||
const QImage &b = std::get<1>(*t);
|
||||
fprintf(stderr,
|
||||
"SETBUFFERS self=%p | A=%dx%d fmt=%d bytesPerLine=%d cbits=%p | "
|
||||
"B=%dx%d fmt=%d | C=%p %dx%d\n",
|
||||
self, a.width(), a.height(), int(a.format()), a.bytesPerLine(),
|
||||
(const void *)a.constBits(), b.width(), b.height(), int(b.format()),
|
||||
(void *)c, c ? c->width() : -1, c ? c->height() : -1);
|
||||
|
||||
if (real) real(self, tuplePtr, imgPtr);
|
||||
}
|
||||
Reference in New Issue
Block a user