xdbe.pp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. (******************************************************************************
  2. *
  3. * Copyright (c) 1994, 1995 Hewlett-Packard Company
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining
  6. * a copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sublicense, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included
  14. * in all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  19. * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
  20. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
  22. * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * Except as contained in this notice, the name of the Hewlett-Packard
  25. * Company shall not be used in advertising or otherwise to promote the
  26. * sale, use or other dealings in this Software without prior written
  27. * authorization from the Hewlett-Packard Company.
  28. *
  29. * Header file for Xlib-related DBE
  30. *
  31. *****************************************************************************)
  32. {$IFNDEF FPC_DOTTEDUNITS}
  33. unit xdbe;
  34. {$ENDIF FPC_DOTTEDUNITS}
  35. {$PACKRECORDS c}
  36. interface
  37. {$IFDEF FPC_DOTTEDUNITS}
  38. uses
  39. System.CTypes, Api.X11.X, Api.X11.Xlib;
  40. {$ELSE FPC_DOTTEDUNITS}
  41. uses
  42. ctypes, x, xlib;
  43. {$ENDIF FPC_DOTTEDUNITS}
  44. const
  45. libXext = 'Xext';
  46. {$I dbe.inc}
  47. type
  48. PXdbeVisualInfo = ^TXdbeVisualInfo;
  49. TXdbeVisualInfo = record
  50. visual: TVisualID; { one visual ID that supports double-buffering }
  51. depth: cint; { depth of visual in bits }
  52. perflevel: cint; { performance level of visual }
  53. end;
  54. PXdbeScreenVisualInfo = ^TXdbeScreenVisualInfo;
  55. TXdbeScreenVisualInfo = record
  56. count: cint; { number of items in visual_depth }
  57. visinfo: PXdbeVisualInfo; { list of visuals & depths for scrn }
  58. end;
  59. PXdbeBackBuffer = ^TXdbeBackBuffer;
  60. TXdbeBackBuffer = TDrawable;
  61. PXdbeSwapAction = ^TXdbeSwapAction;
  62. TXdbeSwapAction = cuchar;
  63. PXdbeSwapInfo = ^TXdbeSwapInfo;
  64. TXdbeSwapInfo = record
  65. swap_window: TWindow; { window for which to swap buffers }
  66. swap_action: TXdbeSwapAction; { swap action to use for swap_window }
  67. end;
  68. PXdbeBackBufferAttributes = ^TXdbeBackBufferAttributes;
  69. TXdbeBackBufferAttributes = record
  70. window: TWindow; { window that buffer belongs to }
  71. end;
  72. PXdbeBufferError = ^TXdbeBufferError;
  73. TXdbeBufferError = record
  74. _type: cint;
  75. display: PDisplay; { display the event was read from }
  76. buffer: TXdbeBackBuffer; { resource id }
  77. serial: culong; { serial number of failed request }
  78. error_code: cuchar; { error base + XdbeBadBuffer }
  79. request_code: cuchar; { major opcode of failed request }
  80. minor_code: cuchar; { minor opcode of failed request }
  81. end;
  82. function XdbeQueryExtension(
  83. dpy: PDisplay;
  84. major_version_return,
  85. minor_version_return: Pcint
  86. ): TStatus; cdecl; external libXext;
  87. function XdbeAllocateBackBufferName(
  88. dpy: PDisplay;
  89. window: TWindow;
  90. swap_action: TXdbeSwapAction
  91. ): TXdbeBackBuffer; cdecl; external libXext;
  92. function XdbeDeallocateBackBufferName(
  93. dpy: PDisplay;
  94. buffer: TXdbeBackBuffer
  95. ): TStatus; cdecl; external libXext;
  96. function XdbeSwapBuffers(
  97. dpy: PDisplay;
  98. swap_info: PXdbeSwapInfo;
  99. num_windows: cint
  100. ): TStatus; cdecl; external libXext;
  101. function XdbeBeginIdiom(
  102. dpy: PDisplay
  103. ): TStatus; cdecl; external libXext;
  104. function XdbeEndIdiom(
  105. dpy: PDisplay
  106. ): TStatus; cdecl; external libXext;
  107. function XdbeGetVisualInfo(
  108. dpy: PDisplay;
  109. screen_specifiers: PDrawable;
  110. num_screens: Pcint
  111. ): PXdbeScreenVisualInfo; cdecl; external libXext;
  112. procedure XdbeFreeVisualInfo(
  113. visual_info: PXdbeScreenVisualInfo
  114. ); cdecl; external libXext;
  115. function XdbeGetBackBufferAttributes(
  116. dpy: PDisplay;
  117. buffer: TXdbeBackBuffer
  118. ): PXdbeBackBufferAttributes; cdecl; external libXext;
  119. implementation
  120. end.