x11windowdisplayd.inc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Type
  2. TX11WindowDisplay = Class(TX11Display)
  3. Private
  4. Function NextEvent(Var AEvent : TPTCEvent; AWait : Boolean; Const AEventMask : TPTCEventMask) : Boolean; Override;
  5. Function PeekEvent(AWait : Boolean; Const AEventMask : TPTCEventMask) : TPTCEvent; Override;
  6. Procedure EnterFullScreen;
  7. Procedure LeaveFullScreen;
  8. Procedure internal_ShowCursor(AVisible : Boolean);
  9. Procedure HandleChangeFocus(ANewFocus : Boolean);
  10. Procedure HandleEvents;
  11. Function CreateImage(ADisplay : PDisplay; AScreen, AWidth, AHeight : Integer;
  12. AFormat : TPTCFormat) : TX11Image; { Factory method }
  13. Function CreateModeSwitcher : TX11Modes; { Factory method }
  14. Procedure CreateColormap; { Register colour maps }
  15. {eventHandler}
  16. FWindow : TWindow;
  17. FPrimary : TX11Image;
  18. FDestX, FDestY : Integer;
  19. FGC : TGC;
  20. FAtomClose : TAtom; { X Atom for close window button }
  21. FCursorVisible : Boolean;
  22. FX11InvisibleCursor : TCursor; { Blank cursor }
  23. FFullScreen : Boolean; { Keeps a snapshot of the PTC_X11_FULLSCREEN option
  24. taken at the time 'open' was called }
  25. FFocus : Boolean;
  26. FModeSwitcher : TX11Modes;
  27. FPreviousMouseButtonState : TPTCMouseButtonState;
  28. FPreviousMouseX, FPreviousMouseY : Integer; { for calculating the deltas }
  29. FPreviousMousePositionSaved : Boolean; { true, if FPreviousMouseX,
  30. FPreviousMouseY and FPreviousMouseButtonState contain valid values }
  31. Public
  32. Constructor Create(ADisplay : PDisplay; AScreen : Integer; Const AFlags : TX11Flags); Override;
  33. Destructor Destroy; Override;
  34. Procedure Open(ATitle : String; AWidth, AHeight : Integer; Const AFormat : TPTCFormat); Override;
  35. Procedure Open(AWindow : TWindow; Const AFormat : TPTCFormat); Override;
  36. Procedure Open(AWindow : TWindow; Const AFormat : TPTCFormat; AX, AY, AWidth, AHeight : Integer); Override;
  37. Procedure Close; Override;
  38. Procedure Update; Override;
  39. Procedure Update(Const AArea : TPTCArea); Override;
  40. Function Lock : Pointer; Override;
  41. Procedure Unlock; Override;
  42. Procedure GetModes(Var AModes : TPTCModeDynArray); Override;
  43. Procedure Palette(Const APalette : TPTCPalette); Override;
  44. Function GetPitch : Integer; Override;
  45. Function GetX11Window : TWindow; Override;
  46. Function GetX11GC : TGC; Virtual;
  47. Function IsFullScreen : Boolean; Override;
  48. Procedure SetCursor(AVisible : Boolean); Override;
  49. End;