mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
45 lines
851 B
C++
45 lines
851 B
C++
/*
|
|
* @Author: DI JUNKUN
|
|
* @Date: 2023-12-14
|
|
* Copyright (c) 2023 by DI JUNKUN, All Rights Reserved.
|
|
*/
|
|
|
|
#ifndef _DEVICE_CONTROLLER_H_
|
|
#define _DEVICE_CONTROLLER_H_
|
|
|
|
#include <stdio.h>
|
|
|
|
typedef enum { mouse = 0, keyboard, audio_capture } ControlType;
|
|
typedef enum { move = 0, left_down, left_up, right_down, right_up } MouseFlag;
|
|
typedef enum { key_down = 0, key_up } KeyFlag;
|
|
typedef struct {
|
|
size_t x;
|
|
size_t y;
|
|
MouseFlag flag;
|
|
} Mouse;
|
|
|
|
typedef struct {
|
|
size_t key_value;
|
|
KeyFlag flag;
|
|
} Key;
|
|
|
|
typedef struct {
|
|
ControlType type;
|
|
union {
|
|
Mouse m;
|
|
Key k;
|
|
bool a;
|
|
};
|
|
} RemoteAction;
|
|
|
|
class DeviceController {
|
|
public:
|
|
virtual ~DeviceController() {}
|
|
|
|
public:
|
|
virtual int Init(int screen_width, int screen_height) = 0;
|
|
virtual int Destroy() = 0;
|
|
virtual int SendCommand(RemoteAction remote_action) = 0;
|
|
};
|
|
|
|
#endif |