CloverBootloader/rEFIt_UEFI/libeg/XPointer.h

57 lines
1.2 KiB
C
Raw Normal View History

#pragma once
extern "C" {
#include <Protocol/SimplePointer.h>
}
#include "XImage.h"
#include "libeg.h"
class XImage;
class XPointer
{
protected:
EFI_SIMPLE_POINTER_PROTOCOL *SimplePointerProtocol;
XImage* PointerImage;
2020-03-09 10:35:14 +01:00
// XImage newImage;
XImage oldImage;
EG_RECT newPlace;
EG_RECT oldPlace;
UINT64 LastClickTime; //not EFI_TIME
EFI_SIMPLE_POINTER_STATE State;
MOUSE_EVENT MouseEvent;
2021-09-28 15:54:31 +02:00
XBool Alive;
XBool night;
public:
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:
void Hide();
2021-09-28 15:54:31 +02:00
XBool isAlive();
EFI_STATUS MouseBirth();
2020-10-03 19:02:31 +02:00
void KillMouse();
2021-09-28 15:54:31 +02:00
void UpdatePointer(XBool daylight);
XBool MouseInRect(EG_RECT *Place);
2021-09-28 15:54:31 +02:00
XBool isEmpty() const { return PointerImage->isEmpty(); }
void ClearEvent() { MouseEvent = NoEvents; }
MOUSE_EVENT GetEvent();
EG_RECT& GetPlace() { return newPlace; }
2020-03-03 14:52:23 +01:00
protected:
2020-10-03 19:02:31 +02:00
void Draw();
void DrawPointer();
};