mirror of https://github.com/Genymobile/scrcpy
Move common structs to coords.h
The size, point and position structs were defined in common.h. Move them to coords.h so that common.h could be used for generic code to be included in all source files.feature_test_macro
parent
037be4af21
commit
6385b8c162
@ -1,30 +1,10 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
||||
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
|
||||
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)
|
||||
|
||||
struct size {
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
};
|
||||
|
||||
struct point {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
};
|
||||
|
||||
struct position {
|
||||
// The video screen size may be different from the real device screen size,
|
||||
// so store to which size the absolute position apply, to scale it
|
||||
// accordingly.
|
||||
struct size screen_size;
|
||||
struct point point;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,24 @@
|
||||
#ifndef SC_COORDS
|
||||
#define SC_COORDS
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct size {
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
};
|
||||
|
||||
struct point {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
};
|
||||
|
||||
struct position {
|
||||
// The video screen size may be different from the real device screen size,
|
||||
// so store to which size the absolute position apply, to scale it
|
||||
// accordingly.
|
||||
struct size screen_size;
|
||||
struct point point;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue