#ifndef SIMDRIVER_H
#define SIMDRIVER_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define Grid_DEFAULT_COLS 6
typedef struct sd_driver sd_driver;
typedef struct sd_frame {
uint32_t width;
uint32_t height;
uint32_t source_width;
uint32_t source_height;
uint64_t seq;
const uint8_t *data;
size_t len;
} sd_frame;
typedef void (*sd_frame_cb)(const struct sd_frame *frame, void *user);
typedef void (*sd_state_cb)(int32_t state, void *user);
struct sd_driver *sd_start(const char *udid,
uint32_t fps,
uint32_t scale,
const char *helper_dir,
sd_frame_cb frame_cb,
sd_state_cb state_cb,
void *user);
void sd_pointer(struct sd_driver *d, int32_t phase_code, double x, double y, uint32_t mask);
void sd_scroll(struct sd_driver *d, int32_t phase_code, double x, double y, double dx, double dy);
void sd_touch2(struct sd_driver *d, int32_t phase_code, double x1, double y1, double x2, double y2);
void sd_tap(struct sd_driver *d, double x, double y);
void sd_double_tap(struct sd_driver *d, double x, double y);
void sd_long_press(struct sd_driver *d, double x, double y, double hold_secs);
void sd_drag(struct sd_driver *d,
double x1,
double y1,
double x2,
double y2,
double hold_secs,
double move_secs);
char *sd_accessibility_json(struct sd_driver *d);
void sd_string_free(char *s);
uint32_t sd_grid_rows(double screen_w, double screen_h, uint32_t cols);
bool sd_grid_cell(double screen_w,
double screen_h,
uint32_t cols,
const char *name,
double *x,
double *y);
bool sd_screen_points(struct sd_driver *d, double *w, double *h);
bool sd_key(struct sd_driver *d, const char *name);
bool sd_key_combo(struct sd_driver *d, const char *combo);
bool sd_open_url(struct sd_driver *d, const char *url);
bool sd_launch(struct sd_driver *d, const char *bundle_id);
bool sd_terminate(struct sd_driver *d, const char *bundle_id);
bool sd_set_location(struct sd_driver *d, double lat, double lon);
bool sd_set_appearance(struct sd_driver *d, int32_t appearance);
bool sd_grant_permission(struct sd_driver *d, const char *service, const char *bundle_id);
bool sd_clipboard_write(struct sd_driver *d, const char *text);
char *sd_clipboard_read(struct sd_driver *d);
bool sd_revoke_permission(struct sd_driver *d, const char *service, const char *bundle_id);
bool sd_reset_permission(struct sd_driver *d, const char *service, const char *bundle_id);
bool sd_set_content_size(struct sd_driver *d, const char *size);
bool sd_status_bar_override(struct sd_driver *d);
bool sd_status_bar_clear(struct sd_driver *d);
bool sd_push_notification(struct sd_driver *d, const char *bundle_id, const char *payload_path);
bool sd_reset_keychain(struct sd_driver *d);
bool sd_clear_app_data(struct sd_driver *d, const char *bundle_id);
char *sd_apps(struct sd_driver *d);
void sd_text(struct sd_driver *d, const char *s);
void sd_button(struct sd_driver *d, int32_t button_code, uint32_t presses, float hold_secs);
void sd_stop(struct sd_driver *d);
const char *sd_last_error(void);
#endif