skyline/app/src/main/cpp/skyline/input/touch.h
PixelyIon fe5061a8e0 Address CR Comments (#132) + Change Core Migration API
This addresses all CR comments including more codebase-wide changes arising from certain review comments like proper usage of its/it's and consistent contraction of it is into it's. 

An overhaul was made to the presentation and formatting of `KThread.h` and `LoadBalance` works has been superseded by `GetOptimalCoreForThread` which can be used alongside `InsertThread` or `MigrateToCore`. It makes the API far more atomic and neater. This was a major point of contention for the design prior, it's simplified some code and potentially improved performance.
2021-03-05 14:55:34 +05:30

42 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 "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);
};
}