#ifndef CHIRAMI_DARWIN_H
#define CHIRAMI_DARWIN_H

#include <stdbool.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    double x, y;
    double screenX, screenY, screenW, screenH;
    double scale;
} CHRAnchor;

void chr_init(void);
void chr_run(void);
void chr_stop(void);

bool chr_checkAccessibility(bool prompt);
char *chr_getSelectedText(bool allowCopyFallback);

CHRAnchor chr_getAnchor(void);
void chr_getPointer(double *outX, double *outY);

void chr_showPopup(const void *bytes, int stride, int width, int height,
                   double x, double y,
                   double hitX, double hitY, double hitW, double hitH,
                   double contentsScale);
void chr_hidePopup(void);

void chr_installMonitors(void);
void chr_uninstallMonitors(void);

bool chr_savePopupSnapshot(const char *path);

bool chr_startScreenshotWatch(void);

#ifdef __cplusplus
}
#endif

#endif // CHIRAMI_DARWIN_H
