displayd.inc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Type
  2. TX11Display = Class(TObject)
  3. Protected
  4. Procedure internal_ReadKey(k : TPTCKey); Virtual; Abstract;
  5. Function internal_PeekKey(k : TPTCKey) : Boolean; Virtual; Abstract;
  6. Function getFormat(Const _format : TPTCFormat) : TPTCFormat;
  7. { initialise the keyboard mapping table }
  8. Procedure setKeyMapping;
  9. { Conversion object }
  10. m_copy : TPTCCopy;
  11. m_clear : TPTCClear;
  12. m_palette : TPTCPalette;
  13. m_area : TPTCArea;
  14. m_clip : TPTCArea;
  15. m_flags : LongInt;
  16. m_width, m_height : DWord;
  17. m_format : TPTCFormat;
  18. m_disp : PDisplay;
  19. m_screen : Integer;
  20. m_cmap : TColormap;
  21. m_colours : PXColor;
  22. m_functionkeys : PInteger;
  23. m_normalkeys : PInteger;
  24. {m_thread : pthread_t;}
  25. Public
  26. Constructor Create;
  27. Destructor Destroy; Override;
  28. {checkDGA}
  29. Procedure open(title : String; _width, _height : Integer; Const _format : TPTCFormat; disp : PDisplay; screen : Integer); Virtual; Abstract;
  30. { This will always return a windowed console. The first version
  31. fills the whole window, the second one has a custom size }
  32. Procedure open(disp : PDisplay; screen : Integer; w : TWindow; Const _format : TPTCFormat); Virtual; Abstract;
  33. Procedure open(disp : PDisplay; screen : Integer; _window : TWindow; Const _format : TPTCFormat; x, y, w, h : Integer); Virtual; Abstract;
  34. Procedure close; Virtual; Abstract;
  35. Procedure update; Virtual; Abstract;
  36. Procedure update(Const _area : TPTCArea); Virtual; Abstract;
  37. Function lock : Pointer; Virtual; Abstract;
  38. Procedure unlock; Virtual; Abstract;
  39. { load pixels to console }
  40. Procedure load(Const pixels : Pointer; _width, _height, _pitch : Integer;
  41. Const _format : TPTCFormat; Const _palette : TPTCPalette); Virtual;
  42. Procedure load(Const pixels : Pointer; _width, _height, _pitch : Integer;
  43. Const _format : TPTCFormat; Const _palette : TPTCPalette;
  44. Const source, destination : TPTCArea); Virtual;
  45. { save console pixels }
  46. Procedure save(pixels : Pointer; _width, _height, _pitch : Integer;
  47. Const _format : TPTCFormat; Const _palette : TPTCPalette); Virtual;
  48. Procedure save(pixels : Pointer; _width, _height, _pitch : Integer;
  49. Const _format : TPTCFormat; Const _palette : TPTCPalette;
  50. Const source, destination : TPTCArea); Virtual;
  51. { clear surface }
  52. Procedure clear(Const color : TPTCColor); Virtual;
  53. Procedure clear(Const color : TPTCColor; Const _area : TPTCArea); Virtual;
  54. { Console palette }
  55. Procedure palette(Const _palette : TPTCPalette); Virtual; Abstract;
  56. Function palette : TPTCPalette; Virtual;
  57. { console clip area }
  58. Procedure clip(Const _area : TPTCArea);
  59. { Data access }
  60. Function width : Integer;
  61. Function height : Integer;
  62. Function pitch : Integer; Virtual; Abstract;
  63. Function clip : TPTCArea;
  64. Function area : TPTCArea;
  65. Function format : TPTCFormat;
  66. { Set flags (only used internally now!) }
  67. Procedure flags(_flags : LongInt);
  68. { X11 helper functions for your enjoyment }
  69. { return the display we are using }
  70. Function getX11Display : PDisplay;
  71. { return the screen we are using }
  72. Function getX11Screen : Integer;
  73. { return our window (0 if DGA) }
  74. Function getX11Window : TWindow; Virtual; Abstract;
  75. End;