2018-01-22 15:50:08 +00:00
|
|
|
#ifndef COMMON_H
|
|
|
|
#define COMMON_H
|
|
|
|
|
2019-03-02 22:52:22 +00:00
|
|
|
#include <stdint.h>
|
2018-01-22 15:50:08 +00:00
|
|
|
|
2018-03-25 13:23:00 +00:00
|
|
|
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
2018-01-22 15:50:08 +00:00
|
|
|
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
|
|
|
|
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)
|
|
|
|
|
|
|
|
struct size {
|
2019-03-02 22:52:22 +00:00
|
|
|
uint16_t width;
|
|
|
|
uint16_t height;
|
2018-01-22 15:50:08 +00:00
|
|
|
};
|
|
|
|
|
2018-01-29 13:52:22 +00:00
|
|
|
struct point {
|
2019-03-02 22:52:22 +00:00
|
|
|
int32_t x;
|
|
|
|
int32_t y;
|
2018-01-22 15:50:08 +00:00
|
|
|
};
|
|
|
|
|
2018-01-29 13:52:22 +00:00
|
|
|
struct position {
|
2018-01-22 15:50:08 +00:00
|
|
|
// The video screen size may be different from the real device screen size,
|
2019-03-02 19:09:56 +00:00
|
|
|
// so store to which size the absolute position apply, to scale it
|
|
|
|
// accordingly.
|
2018-01-22 15:50:08 +00:00
|
|
|
struct size screen_size;
|
2018-01-29 13:52:22 +00:00
|
|
|
struct point point;
|
2018-01-22 15:50:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|