Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <functional>
9
10// local includes
11#include "platform/common.h"
12#include "thread_safe.h"
13#include "crypto.h"
14
15namespace input {
16 struct input_t;
17
18 void print(void *input);
19 void reset(std::shared_ptr<input_t> &input);
20 void passthrough(std::shared_ptr<input_t> &input, std::vector<std::uint8_t> &&input_data, const crypto::PERM& permission);
21
22 [[nodiscard]] std::unique_ptr<platf::deinit_t> init();
23
24 bool probe_gamepads();
25
32 std::shared_ptr<input_t> alloc(
33 safe::mail_t mail,
34 const std::string &session_tag = {},
35 int launch_gamepads = 0,
36 const std::string &wayland_socket = {},
37 const std::string &client_id = {}
38 );
39
40#ifdef HERMES_TESTS
48 std::shared_ptr<input_t> alloc_for_testing(
49 safe::mail_t mail,
50 std::shared_ptr<platf::input_t> platform,
51 std::unique_ptr<platf::client_input_t> client
52 );
53#endif
54
67 platf::touch_port_t direct_device_port(
68 int output_width,
69 int output_height,
70 int offset_x,
71 int offset_y,
72 int env_width,
73 int env_height,
74 bool binds_to_output
75 );
76
78 int env_width, env_height;
79
87
88 // Offset x and y coordinates of the client
89 float client_offsetX, client_offsetY;
90
91 float scalar_inv;
92
93 explicit operator bool() const {
94 return width != 0 && height != 0 && env_width != 0 && env_height != 0;
95 }
96 };
97
105 std::pair<float, float> scale_client_contact_area(const std::pair<float, float> &val, uint16_t rotation, const std::pair<float, float> &scalar);
106} // namespace input
Declarations for common platform specific utilities.
Declarations for cryptography functions.
platf::touch_port_t direct_device_port(int output_width, int output_height, int offset_x, int offset_y, int env_width, int env_height, bool binds_to_output)
The rectangle a touchscreen or a pen is addressed in.
Definition input.cpp:963
std::shared_ptr< input_t > alloc(safe::mail_t mail, const std::string &session_tag, int launch_gamepads, const std::string &wayland_socket, const std::string &client_id)
Definition input.cpp:1854
std::optional< std::string > wayland_socket(const std::string &client_uuid)
The name of the Wayland socket the session's compositor created.
platf::touch_port_t device_port
Definition input.h:86
Declarations for thread-safe data structures.