mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-06-01 08:28:47 +02:00
eff5711c49
* Resolves dependency cycles in some components * Allows for easier navigation of certain components like `span` which were especially large * Some imports have been moved from `common.h` into their own files due to their infrequency
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
|
|
|
#pragma once
|
|
|
|
#include <jni.h>
|
|
#include "shared_mem.h"
|
|
|
|
namespace skyline::input {
|
|
/*
|
|
* @brief A description of a point being touched on the screen
|
|
* @note All members are jint as it's treated as a jint array in Kotlin
|
|
* @note This structure corresponds to TouchScreenStateData, see that for details
|
|
*/
|
|
struct TouchScreenPoint {
|
|
jint x;
|
|
jint y;
|
|
jint minor;
|
|
jint major;
|
|
jint angle;
|
|
};
|
|
|
|
/**
|
|
* @brief This class is used to manage the shared memory responsible for touch-screen data
|
|
*/
|
|
class TouchManager {
|
|
private:
|
|
const DeviceState &state;
|
|
bool activated{};
|
|
TouchScreenSection §ion;
|
|
|
|
public:
|
|
/**
|
|
* @param hid A pointer to HID Shared Memory on the host
|
|
*/
|
|
TouchManager(const DeviceState &state, input::HidSharedMemory *hid);
|
|
|
|
void Activate();
|
|
|
|
void SetState(const span<TouchScreenPoint> &points);
|
|
};
|
|
}
|