60 lines
1.8 KiB
C++
60 lines
1.8 KiB
C++
#ifndef CAMERA_H__
|
|
#define CAMERA_H__
|
|
|
|
/* *******************************************************************
|
|
* Includes
|
|
* ******************************************************************/
|
|
|
|
#include "Cursor.h"
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
/* *******************************************************************
|
|
* Defines
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Global types definition
|
|
* ******************************************************************/
|
|
|
|
/* Forward declaration. */
|
|
class Cursor;
|
|
|
|
/* *******************************************************************
|
|
* Global variables declaration
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Global functions declaration
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Class definition
|
|
* ******************************************************************/
|
|
|
|
class Camera
|
|
{
|
|
public:
|
|
Camera(void);
|
|
void adjustLock(const bool bLock);
|
|
bool isLocked(void) const;
|
|
int16_t getX(const uint16_t x) const;
|
|
int16_t getY(const uint16_t y) const;
|
|
uint16_t getRealX(const int16_t x) const;
|
|
uint16_t getRealY(const int16_t y) const;
|
|
|
|
/* Event handlers. */
|
|
void onLeftBtnPressed(Cursor& cursor);
|
|
void onRightBtnPressed(Cursor& cursor);
|
|
void onUpBtnPressed(Cursor& cursor);
|
|
void onDownBtnPressed(Cursor& cursor);
|
|
|
|
private:
|
|
bool _bLocked;
|
|
int16_t _xOffset;
|
|
int16_t _yOffset;
|
|
uint8_t _speedTimer;
|
|
};
|
|
|
|
#endif /* CAMERA_H__ */
|