提交 6385b8c1 编写于 作者: R Romain Vimont

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.
上级 037be4af
#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
......@@ -8,7 +8,7 @@
#include "config.h"
#include "android/input.h"
#include "android/keycodes.h"
#include "common.h"
#include "coords.h"
#define CONTROL_MSG_MAX_SIZE (1 << 18) // 256k
......
#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
......@@ -4,7 +4,7 @@
#include <stdbool.h>
#include "config.h"
#include "common.h"
#include "coords.h"
#include "util/net.h"
#define DEVICE_NAME_FIELD_LENGTH 64
......
......@@ -6,7 +6,6 @@
#include <SDL2/SDL.h>
#include "config.h"
#include "common.h"
#include "controller.h"
#include "fps_counter.h"
#include "scrcpy.h"
......
......@@ -7,7 +7,7 @@
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "common.h"
#include "coords.h"
#include "scrcpy.h"
#include "util/queue.h"
......
......@@ -14,7 +14,6 @@
#endif
#include "config.h"
#include "common.h"
#include "compat.h"
#include "controller.h"
#include "decoder.h"
......
......@@ -6,7 +6,7 @@
#include <libavformat/avformat.h>
#include "config.h"
#include "common.h"
#include "coords.h"
#include "opengl.h"
struct video_buffer;
......
......@@ -8,7 +8,6 @@
#include "config.h"
#include "adb.h"
#include "common.h"
#include "scrcpy.h"
#include "util/log.h"
#include "util/net.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册