2020-03-02 13:00:24 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-02-06 18:16:46 +01:00
|
|
|
extern "C" {
|
|
|
|
#include <Protocol/SimplePointer.h>
|
|
|
|
}
|
2020-03-02 13:00:24 +01:00
|
|
|
#include "XImage.h"
|
2020-03-26 18:00:53 +01:00
|
|
|
#include "libeg.h"
|
2020-03-02 13:00:24 +01:00
|
|
|
|
|
|
|
class XImage;
|
|
|
|
|
|
|
|
class XPointer
|
|
|
|
{
|
|
|
|
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:
|
2021-02-06 18:16:46 +01:00
|
|
|
XPointer() : SimplePointerProtocol(NULL), PointerImage(NULL),
|
|
|
|
oldImage(0, 0), newPlace(), oldPlace(), LastClickTime(0), State{0,0,0,0,0}, MouseEvent(NoEvents), Alive(false), night(false)
|
|
|
|
{}
|
|
|
|
XPointer(const XPointer&) = delete;
|
|
|
|
XPointer& operator=(const XPointer&) = delete;
|
|
|
|
|
|
|
|
~XPointer() {};
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
2020-03-02 13:00:24 +01:00
|
|
|
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
|
|
|
};
|