Add Inter Fonts

This commit is contained in:
2024-06-12 13:27:38 +02:00
parent b0ef96e390
commit 51f6fa6014
631 changed files with 117874 additions and 2514 deletions

View File

@ -0,0 +1,174 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
*******************************************************************************/
/**
* @file touchgfx/events/ClickEvent.hpp
*
* Declares the touchgfx::ClickEvent class.
*/
#ifndef TOUCHGFX_CLICKEVENT_HPP
#define TOUCHGFX_CLICKEVENT_HPP
#include <touchgfx/Event.hpp>
#include <touchgfx/hal/Types.hpp>
namespace touchgfx
{
/**
* A click event. The semantics of this event is slightly depending on hardware platform.
* ClickEvents are generated by the HAL layer.
*
* @see Event
*/
class ClickEvent : public Event
{
public:
/** Values that represent click event types. */
enum ClickEventType
{
PRESSED, ///< An enum constant representing the pressed option
RELEASED, ///< An enum constant representing the released option
CANCEL ///< An enum constant representing the cancel option
};
/**
* Initializes a new instance of the ClickEvent class.
*
* @param type The type of the click event.
* @param x The x coordinate of the click event.
* @param y The y coordinate of the click event.
* @param force (Optional) The force of the click. On touch displays this usually means how
* hard the user pressed on the display. On the windows platform, this
* will always be zero.
*/
ClickEvent(ClickEventType type, int16_t x, int16_t y, int16_t force = 0)
: clickEventType(type), clickX(x), clickY(y), clickForce(force)
{
}
/**
* Copy constructor.
*
* @param clickEvent The click event.
*/
ClickEvent(const ClickEvent& clickEvent)
{
*this = clickEvent;
}
/**
* Gets the x coordinate of this event.
*
* @return The x coordinate of this event.
*/
int16_t getX() const
{
return clickX;
}
/**
* Gets the y coordinate of this event.
*
* @return The y coordinate of this event.
*/
int16_t getY() const
{
return clickY;
}
/**
* Sets the x coordinate of this event.
*
* @param x The x coordinate of this event.
*/
void setX(int16_t x)
{
clickX = x;
}
/**
* Sets the y coordinate of this event.
*
* @param y The y coordinate of this event.
*/
void setY(int16_t y)
{
clickY = y;
}
/**
* Sets the click type of this event.
*
* @param type The type to set.
*/
void setType(ClickEventType type)
{
clickEventType = type;
}
/**
* Gets the click type of this event.
*
* @return The click type of this event.
*/
ClickEventType getType() const
{
return clickEventType;
}
/**
* Gets the force of the click. On touch displays this usually means how hard the user
* pressed on the display. On the windows platform, this will always be zero.
*
* @return The force of the click.
*/
int16_t getForce() const
{
return clickForce;
}
/**
* Gets event type.
*
* @return The type of this event.
*/
virtual Event::EventType getEventType() const
{
return Event::EVENT_CLICK;
}
/**
* Assignment operator.
*
* @param clickEvent The click event.
*
* @return A shallow copy of this object.
*/
const ClickEvent& operator=(const ClickEvent& clickEvent)
{
clickEventType = clickEvent.clickEventType;
clickX = clickEvent.clickX;
clickY = clickEvent.clickY;
clickForce = clickEvent.clickForce;
return *this;
}
private:
ClickEventType clickEventType;
int16_t clickX;
int16_t clickY;
int16_t clickForce;
};
} // namespace touchgfx
#endif // TOUCHGFX_CLICKEVENT_HPP

View File

@ -0,0 +1,174 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
*******************************************************************************/
/**
* @file touchgfx/events/DragEvent.hpp
*
* Declares the touchgfx::DragEvent class.
*/
#ifndef TOUCHGFX_DRAGEVENT_HPP
#define TOUCHGFX_DRAGEVENT_HPP
#include <touchgfx/Event.hpp>
#include <touchgfx/hal/Types.hpp>
namespace touchgfx
{
/**
* A drag event. The only drag event currently supported is DRAGGED,
* which will be issued every time the input system detects a drag.
*
* @see Event
*/
class DragEvent : public Event
{
public:
/** Values that represent drag event types. */
enum DragEventType
{
DRAGGED ///< An enum constant representing the dragged option
};
/**
* Initializes a new instance of the DragEvent class.
*
* @param type The type of the drag event.
* @param oldX The x coordinate of the drag start position (dragged from)
* @param oldY The y coordinate of the drag start position (dragged from)
* @param newX The x coordinate of the new position (dragged to)
* @param newY The y coordinate of the new position (dragged to)
*/
DragEvent(DragEventType type, int16_t oldX, int16_t oldY, int16_t newX, int16_t newY)
: dragEventType(type), dragOldX(oldX), dragOldY(oldY), dragNewX(newX), dragNewY(newY)
{
}
/**
* Copy constructor.
*
* @param dragEvent The drag event.
*/
DragEvent(const DragEvent& dragEvent)
{
*this = dragEvent;
}
/**
* Gets the old x coordinate, i.e. where the drag operation was
* started (dragged from).
*
* @return The old x coordinate, i.e. where the drag operation was started (dragged from).
*/
int16_t getOldX() const
{
return dragOldX;
}
/**
* Gets the old y coordinate, i.e. where the drag operation was
* started (dragged from).
*
* @return The old y coordinate, i.e. where the drag operation was started (dragged from).
*/
int16_t getOldY() const
{
return dragOldY;
}
/**
* Gets the new x coordinate (dragged to).
*
* @return The new x coordinate (dragged to).
*/
int16_t getNewX() const
{
return dragNewX;
}
/**
* Gets the new x coordinate (dragged to).
*
* @return The new y coordinate (dragged to).
*/
int16_t getNewY() const
{
return dragNewY;
}
/**
* Gets the type of this drag event.
*
* @return The type of this drag event.
*/
DragEventType getType() const
{
return dragEventType;
}
/**
* Gets the distance in x coordinates (how long was the drag).
*
* @return The distance of this drag event.
*/
int16_t getDeltaX() const
{
return dragNewX - dragOldX;
}
/**
* Gets the distance in y coordinates (how long was the drag).
*
* @return The distance of this drag event.
*/
int16_t getDeltaY() const
{
return dragNewY - dragOldY;
}
/**
* Gets event type.
*
* @return The type of this event.
*/
virtual Event::EventType getEventType() const
{
return Event::EVENT_DRAG;
}
/**
* Assignment operator.
*
* @param dragEvent The drag event.
*
* @return A shallow copy of this object.
*/
const DragEvent& operator=(const DragEvent& dragEvent)
{
dragEventType = dragEvent.dragEventType;
dragOldX = dragEvent.dragOldX;
dragOldY = dragEvent.dragOldY;
dragNewX = dragEvent.dragNewX;
dragNewY = dragEvent.dragNewY;
return *this;
}
private:
DragEventType dragEventType;
int16_t dragOldX;
int16_t dragOldY;
int16_t dragNewX;
int16_t dragNewY;
};
} // namespace touchgfx
#endif // TOUCHGFX_DRAGEVENT_HPP

View File

@ -0,0 +1,150 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
*******************************************************************************/
/**
* @file touchgfx/events/GestureEvent.hpp
*
* Declares the touchgfx::GestureEvent class.
*/
#ifndef TOUCHGFX_GESTUREEVENT_HPP
#define TOUCHGFX_GESTUREEVENT_HPP
#include <touchgfx/Event.hpp>
#include <touchgfx/hal/Types.hpp>
namespace touchgfx
{
/**
* A gesture event. The only gesture events currently supported is #SWIPE_HORIZONTAL and
* #SWIPE_VERTICAL, which will be issued every time the input system detects a swipe.
*
* @see Event
*/
class GestureEvent : public Event
{
public:
/** Values that represent gesture types. */
enum GestureEventType
{
SWIPE_HORIZONTAL, ///< An enum constant representing a horizontal swipe
SWIPE_VERTICAL ///< An enum constant representing a vertical swipe
};
/**
* Constructor. Create a gesture event of the specified type with the specified
* coordinates.
*
* @param type The type of the gesture event.
* @param velocity The velocity of this gesture (swipe)
* @param x The x coordinate of the gesture.
* @param y The y coordinate of the gesture.
*/
GestureEvent(GestureEventType type, int16_t velocity, int16_t x, int16_t y)
: gestureEventType(type),
gestureVelocity(velocity),
gestureX(x),
gestureY(y)
{
}
/**
* Copy constructor.
*
* @param gestureEvent The gesture event.
*/
GestureEvent(const GestureEvent& gestureEvent)
{
*this = gestureEvent;
}
/**
* Gets the velocity of this gesture event.
*
* @return The velocity of this gesture event.
*/
int16_t getVelocity() const
{
return gestureVelocity;
}
/**
* Gets the type of this gesture event.
*
* @return The type of this gesture event.
*/
GestureEventType getType() const
{
return gestureEventType;
}
/**
* Gets the x coordinate of this gesture event.
*
* @return The x coordinate of this gesture event.
*/
int16_t getX() const
{
return gestureX;
}
/**
* Gets the y coordinate of this gesture event.
*
* @return The y coordinate of this gesture event.
*/
int16_t getY() const
{
return gestureY;
}
/**
* Gets event type.
*
* @return The type of this event.
*/
virtual Event::EventType getEventType() const
{
return Event::EVENT_GESTURE;
}
/**
* Assignment operator.
*
* @param gestureEvent The gesture event.
*
* @return A shallow copy of this object.
*/
const GestureEvent& operator=(const GestureEvent& gestureEvent)
{
gestureEventType = gestureEvent.gestureEventType;
gestureVelocity = gestureEvent.gestureVelocity;
gestureX = gestureEvent.gestureX;
gestureY = gestureEvent.gestureY;
return *this;
}
private:
/** Initializes a new instance of the GestureEvent class. */
GestureEvent()
: gestureEventType(SWIPE_HORIZONTAL), gestureVelocity(0), gestureX(0), gestureY(0)
{
}
GestureEventType gestureEventType;
int16_t gestureVelocity;
int16_t gestureX;
int16_t gestureY;
};
} // namespace touchgfx
#endif // TOUCHGFX_GESTUREEVENT_HPP