summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.h
diff options
context:
space:
mode:
author Byoungho Jung <bh.jung@samsung.corp-partner.google.com> 2023-10-27 18:15:41 +0900
committer Prabir Pradhan <prabirmsp@google.com> 2023-11-08 20:29:09 +0000
commit51282e866164abcd81049e7837a44111c4ae5807 (patch)
tree1fc9506f861c9bb074662fbd6dd1d67cc5d169f2 /libs/input/PointerController.h
parente35a7eadf9f88c451a72a13a872eb05aae3bb69f (diff)
Pointer icon refactor for touch (base)
When PointerChoreographer is enabled, PointerChoreographer can create multiple TouchPointerControllers for each touch device when 'Show taps' is enabled. A TouchPointerController is reponsible for one touch device and it can show touch spots on the associated display. Test: atest libinputservice_test Bug: 293587049 Change-Id: I1a624a6a50023c530e709cc5fc0704b0b997125b
Diffstat (limited to 'libs/input/PointerController.h')
-rw-r--r--libs/input/PointerController.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index 08e19a096d87..1a8e109af328 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -68,7 +68,7 @@ public:
void updatePointerIcon(PointerIconStyle iconId);
void setCustomPointerIcon(const SpriteIcon& icon);
- void setInactivityTimeout(InactivityTimeout inactivityTimeout);
+ virtual void setInactivityTimeout(InactivityTimeout inactivityTimeout);
void doInactivityTimeout();
void reloadPointerResources();
void onDisplayViewportsUpdated(const std::vector<DisplayViewport>& viewports);
@@ -154,6 +154,50 @@ public:
}
};
+class TouchPointerController : public PointerController {
+public:
+ /** A version of PointerController that controls touch spots. */
+ TouchPointerController(const sp<PointerControllerPolicyInterface>& policy,
+ const sp<Looper>& looper, SpriteController& spriteController,
+ bool enabled);
+
+ std::optional<FloatRect> getBounds() const override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void move(float, float) override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void setPosition(float, float) override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ FloatPoint getPosition() const override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ int32_t getDisplayId() const override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void fade(Transition) override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void unfade(Transition) override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void setDisplayViewport(const DisplayViewport&) override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void setPresentation(Presentation) override {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void updatePointerIcon(PointerIconStyle) {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ void setCustomPointerIcon(const SpriteIcon&) {
+ LOG_ALWAYS_FATAL("Should not be called");
+ }
+ // fade() should not be called by inactivity timeout. Do nothing.
+ void setInactivityTimeout(InactivityTimeout) override {}
+};
+
} // namespace android
#endif // _UI_POINTER_CONTROLLER_H