skyline/app/src/main/cpp/skyline/input/touch.h
PixelyIon eff5711c49 Split monolithic common.h into smaller chunks
* 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
2021-10-26 10:46:36 +05:30

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 &section;
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);
};
}