#pragma once

// Direct access to the private EPFramebuffer singleton in libqsgepaper.so, for
// the screen-mode experiment. We bind to the exact mangled symbols via asm
// labels (no class declaration, so no vtable issues). QRect is passed by value
// as its raw {left,top,right,bottom} layout; the enums/QFlags are int-sized.

struct EpRect { int x1, y1, x2, y2; }; // == QRect internal layout

void *epfb_instance() asm("_ZN13EPFramebuffer8instanceEv");

void epfb_swapBuffers(void *self, EpRect r, int contentType, int screenMode, int flags)
    asm("_ZN13EPFramebuffer11swapBuffersE5QRect13EPContentType12EPScreenMode6QFlagsINS_10UpdateFlagEE");

// Anti-ghost full refresh. The color panel (EPFramebufferAcep2) overrides this;
// modes 0/3 do an immediate full-screen de-ghosting refresh of the current
// framebuffer, mode 1 schedules one. Call with the instance() pointer.
void epfb_ghostControl(void *self, int mode)
    asm("_ZN18EPFramebufferAcep212ghostControlEN13EPFramebuffer16GhostControlModeE");
