aboutsummaryrefslogtreecommitdiff
path: root/core.h
blob: d6047f7afaa8949918f2747802f3fc4607dce34d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* core.h - platform-independent interaction logic. */
#ifndef MOUSEBOARD_CORE_H
#define MOUSEBOARD_CORE_H

#include "config.h"
#include "platform.h"

/*
 * Run the full flow: draw the grid, read keys, refine by bisection, and click.
 * If dry_run is set, the chosen target and action are printed to stdout instead
 * of moving/clicking the pointer.
 *
 * Returns 0 if an action was taken, 1 if the user cancelled, 2 on error.
 */
int core_run(struct platform *p, const struct config *cfg, int dry_run);

/* Offline checks of the pure logic (labels, bisection, config). Prints results;
 * returns 0 if all pass. Needs no display. */
int core_selftest(void);

#endif /* MOUSEBOARD_CORE_H */