Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
touch_gva.h
Go to the documentation of this file.
1//
2// Copyright (c) 2023, DefenceX PTY LTD
3//
4// This file is part of the VivoeX project developed by DefenceX.
5//
6// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7// License. See the LICENSE file in the project root for full license details.
8//
13
14#ifndef HMICORE_TOUCH_GVA_H_
15#define HMICORE_TOUCH_GVA_H_
16
17#include <vector>
18
19#include "hmicore/gva.h"
21
22namespace gva {
23
25class Hotspot : public RenderBase {
26 public:
34 Hotspot(GvaFunctionGroupEnum groupId, uint32_t x, uint32_t y) : RenderBase(x, y), group_id_(groupId), binding_(0) {}
35
46 Hotspot(GvaFunctionGroupEnum groupId, uint32_t binding, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
47 : RenderBase(x, y, width, height), group_id_(groupId), binding_(binding) {}
48
54 GvaFunctionGroupEnum GetGroupId() const { return group_id_; }
55
61 uint32_t GetBinding() const { return binding_; }
62
63 private:
65 GvaFunctionGroupEnum group_id_;
66 // Bind a value or a key to this Hotspot
67 uint32_t binding_;
68};
69
71class TouchGva {
72 public:
81 GvaStatusTypes Add(GvaFunctionGroupEnum groupId, uint32_t x, uint32_t y);
82
94 GvaStatusTypes Add(GvaFunctionGroupEnum groupId, uint32_t binding, uint32_t x, uint32_t y, uint32_t width,
95 uint32_t height);
96
108 GvaStatusTypes AddAbsolute(GvaFunctionGroupEnum groupId, uint32_t binding, uint32_t x, uint32_t y, uint32_t xx,
109 uint32_t yy);
110
117 void SetResolution(uint32_t x, uint32_t y);
118
123 void Reset();
124
135 bool Check(GvaFunctionGroupEnum groupId, uint32_t *binding, uint32_t x, uint32_t y) const;
136
137 private:
139 uint32_t x_;
141 uint32_t y_;
143 std::vector<Hotspot> hotspots_;
144};
145
146} // namespace gva
147
148#endif // HMICORE_TOUCH_GVA_H_
Class defining the render base.
Definition touch_gva.h:25
uint32_t GetBinding() const
Get the Binding attribute.
Definition touch_gva.h:61
Hotspot(GvaFunctionGroupEnum groupId, uint32_t x, uint32_t y)
Construct a new Hotspot object.
Definition touch_gva.h:34
Hotspot(GvaFunctionGroupEnum groupId, uint32_t binding, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
Construct a new Hotspot object.
Definition touch_gva.h:46
GvaFunctionGroupEnum GetGroupId() const
Get the Group Id attribute.
Definition touch_gva.h:54
Class defining the base renderer.
Definition renderer_base.h:23
Class defining the touch screen events.
Definition touch_gva.h:71
void SetResolution(uint32_t x, uint32_t y)
Set the Resolution attribute.
Definition touch_gva.cc:37
void Reset()
Reset all the hotspots.
Definition touch_gva.cc:42
GvaStatusTypes AddAbsolute(GvaFunctionGroupEnum groupId, uint32_t binding, uint32_t x, uint32_t y, uint32_t xx, uint32_t yy)
Construct a new Touch Gva object.
Definition touch_gva.cc:31
GvaStatusTypes Add(GvaFunctionGroupEnum groupId, uint32_t x, uint32_t y)
Construct a new Touch Gva object.
Definition touch_gva.cc:20
bool Check(GvaFunctionGroupEnum groupId, uint32_t *binding, uint32_t x, uint32_t y) const
Check if a touch event is within a hotspot.
Definition touch_gva.cc:44
GvaStatusTypes
HMI erro types, can be extended if needed.
Definition gva.h:186
GvaFunctionGroupEnum
These are the functional groups.
Definition gva.h:232
The base of and renderer class.