2020-03-02 13:00:24 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "XImage.h"
|
2020-03-06 08:55:52 +01:00
|
|
|
//#include "../refit/IO.h"
|
2020-03-26 18:00:53 +01:00
|
|
|
#include "libeg.h"
|
2020-03-02 13:00:24 +01:00
|
|
|
|
|
|
|
class XImage;
|
|
|
|
|
|
|
|
class XPointer
|
|
|
|
{
|
|
|
|
public:
|
2020-08-11 14:43:53 +02:00
|
|
|
XPointer() : SimplePointerProtocol(NULL), PointerImage(NULL),
|
|
|
|
oldImage(0, 0), newPlace(), oldPlace(), LastClickTime(0), State{0}, MouseEvent(NoEvents), Alive(false), night(false)
|
|
|
|
{}
|
|
|
|
XPointer(const XPointer&) = delete;
|
|
|
|
XPointer& operator=(const XPointer&) = delete;
|
|
|
|
|
|
|
|
~XPointer() {};
|
2020-03-02 13:00:24 +01:00
|
|
|
|
|
|
|
protected:
|
2020-03-02 20:00:01 +01:00
|
|
|
EFI_SIMPLE_POINTER_PROTOCOL *SimplePointerProtocol;
|
2020-03-06 20:56:32 +01:00
|
|
|
XImage* PointerImage;
|
2020-03-09 10:35:14 +01:00
|
|
|
// XImage newImage;
|
2020-03-02 20:02:28 +01:00
|
|
|
XImage oldImage;
|
2020-03-02 20:00:01 +01:00
|
|
|
|
|
|
|
EG_RECT newPlace;
|
|
|
|
EG_RECT oldPlace;
|
|
|
|
|
|
|
|
UINT64 LastClickTime; //not EFI_TIME
|
|
|
|
EFI_SIMPLE_POINTER_STATE State;
|
2020-03-02 13:00:24 +01:00
|
|
|
MOUSE_EVENT MouseEvent;
|
2020-03-03 15:17:39 +01:00
|
|
|
bool Alive;
|
2020-05-17 20:56:10 +02:00
|
|
|
bool night;
|
2020-03-02 13:00:24 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
void Hide();
|
2020-03-03 15:17:39 +01:00
|
|
|
bool isAlive();
|
2020-03-02 13:00:24 +01:00
|
|
|
EFI_STATUS MouseBirth();
|
2020-10-03 19:02:31 +02:00
|
|
|
void KillMouse();
|
|
|
|
void UpdatePointer(bool daylight);
|
2020-03-02 13:00:24 +01:00
|
|
|
bool MouseInRect(EG_RECT *Place);
|
|
|
|
|
2020-03-06 20:56:32 +01:00
|
|
|
bool isEmpty() const { return PointerImage->isEmpty(); }
|
2020-04-02 16:03:58 +02:00
|
|
|
void ClearEvent() { MouseEvent = NoEvents; }
|
|
|
|
MOUSE_EVENT GetEvent();
|
|
|
|
EG_RECT& GetPlace() { return newPlace; }
|
2020-03-03 14:52:23 +01:00
|
|
|
|
2020-03-02 13:00:24 +01:00
|
|
|
protected:
|
2020-10-03 19:02:31 +02:00
|
|
|
void Draw();
|
|
|
|
void DrawPointer();
|
2020-03-02 20:00:01 +01:00
|
|
|
};
|