scrnintstr.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /***********************************************************
  2. Copyright 1987, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included in
  9. all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  14. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  15. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. Except as contained in this notice, the name of The Open Group shall not be
  17. used in advertising or otherwise to promote the sale, use or other dealings
  18. in this Software without prior written authorization from The Open Group.
  19. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  20. All Rights Reserved
  21. Permission to use, copy, modify, and distribute this software and its
  22. documentation for any purpose and without fee is hereby granted,
  23. provided that the above copyright notice appear in all copies and that
  24. both that copyright notice and this permission notice appear in
  25. supporting documentation, and that the name of Digital not be
  26. used in advertising or publicity pertaining to distribution of the
  27. software without specific, written prior permission.
  28. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  29. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  30. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  31. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  32. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  33. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  34. SOFTWARE.
  35. ******************************************************************/
  36. #ifndef SCREENINTSTRUCT_H
  37. #define SCREENINTSTRUCT_H
  38. #include "screenint.h"
  39. #include "regionstr.h"
  40. #include "colormap.h"
  41. #include "cursor.h"
  42. #include "validate.h"
  43. #include <X11/Xproto.h>
  44. #include "dix.h"
  45. typedef struct _PixmapFormat {
  46. unsigned char depth;
  47. unsigned char bitsPerPixel;
  48. unsigned char scanlinePad;
  49. } PixmapFormatRec;
  50. typedef struct _Visual {
  51. VisualID vid;
  52. short class;
  53. short bitsPerRGBValue;
  54. short ColormapEntries;
  55. short nplanes;/* = log2 (ColormapEntries). This does not
  56. * imply that the screen has this many planes.
  57. * it may have more or fewer */
  58. unsigned long redMask, greenMask, blueMask;
  59. int offsetRed, offsetGreen, offsetBlue;
  60. } VisualRec;
  61. typedef struct _Depth {
  62. unsigned char depth;
  63. short numVids;
  64. VisualID *vids; /* block of visual ids for this depth */
  65. } DepthRec;
  66. /*
  67. * There is a typedef for each screen function pointer so that code that
  68. * needs to declare a screen function pointer (e.g. in a screen private
  69. * or as a local variable) can easily do so and retain full type checking.
  70. */
  71. typedef Bool (* CloseScreenProcPtr)(
  72. int /*index*/,
  73. ScreenPtr /*pScreen*/);
  74. typedef void (* QueryBestSizeProcPtr)(
  75. int /*class*/,
  76. unsigned short * /*pwidth*/,
  77. unsigned short * /*pheight*/,
  78. ScreenPtr /*pScreen*/);
  79. typedef Bool (* SaveScreenProcPtr)(
  80. ScreenPtr /*pScreen*/,
  81. int /*on*/);
  82. typedef void (* GetImageProcPtr)(
  83. DrawablePtr /*pDrawable*/,
  84. int /*sx*/,
  85. int /*sy*/,
  86. int /*w*/,
  87. int /*h*/,
  88. unsigned int /*format*/,
  89. unsigned long /*planeMask*/,
  90. char * /*pdstLine*/);
  91. typedef void (* GetSpansProcPtr)(
  92. DrawablePtr /*pDrawable*/,
  93. int /*wMax*/,
  94. DDXPointPtr /*ppt*/,
  95. int* /*pwidth*/,
  96. int /*nspans*/,
  97. char * /*pdstStart*/);
  98. typedef void (* PointerNonInterestBoxProcPtr)(
  99. ScreenPtr /*pScreen*/,
  100. BoxPtr /*pBox*/);
  101. typedef void (* SourceValidateProcPtr)(
  102. DrawablePtr /*pDrawable*/,
  103. int /*x*/,
  104. int /*y*/,
  105. int /*width*/,
  106. int /*height*/);
  107. typedef Bool (* CreateWindowProcPtr)(
  108. WindowPtr /*pWindow*/);
  109. typedef Bool (* DestroyWindowProcPtr)(
  110. WindowPtr /*pWindow*/);
  111. typedef Bool (* PositionWindowProcPtr)(
  112. WindowPtr /*pWindow*/,
  113. int /*x*/,
  114. int /*y*/);
  115. typedef Bool (* ChangeWindowAttributesProcPtr)(
  116. WindowPtr /*pWindow*/,
  117. unsigned long /*mask*/);
  118. typedef Bool (* RealizeWindowProcPtr)(
  119. WindowPtr /*pWindow*/);
  120. typedef Bool (* UnrealizeWindowProcPtr)(
  121. WindowPtr /*pWindow*/);
  122. typedef void (* RestackWindowProcPtr)(
  123. WindowPtr /*pWindow*/,
  124. WindowPtr /*pOldNextSib*/);
  125. typedef int (* ValidateTreeProcPtr)(
  126. WindowPtr /*pParent*/,
  127. WindowPtr /*pChild*/,
  128. VTKind /*kind*/);
  129. typedef void (* PostValidateTreeProcPtr)(
  130. WindowPtr /*pParent*/,
  131. WindowPtr /*pChild*/,
  132. VTKind /*kind*/);
  133. typedef void (* WindowExposuresProcPtr)(
  134. WindowPtr /*pWindow*/,
  135. RegionPtr /*prgn*/,
  136. RegionPtr /*other_exposed*/);
  137. typedef void (* PaintWindowProcPtr)(
  138. WindowPtr /*pWindow*/,
  139. RegionPtr /*pRegion*/,
  140. int /*what*/);
  141. typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr;
  142. typedef PaintWindowProcPtr PaintWindowBorderProcPtr;
  143. typedef void (* CopyWindowProcPtr)(
  144. WindowPtr /*pWindow*/,
  145. DDXPointRec /*ptOldOrg*/,
  146. RegionPtr /*prgnSrc*/);
  147. typedef void (* ClearToBackgroundProcPtr)(
  148. WindowPtr /*pWindow*/,
  149. int /*x*/,
  150. int /*y*/,
  151. int /*w*/,
  152. int /*h*/,
  153. Bool /*generateExposures*/);
  154. typedef void (* ClipNotifyProcPtr)(
  155. WindowPtr /*pWindow*/,
  156. int /*dx*/,
  157. int /*dy*/);
  158. typedef PixmapPtr (* CreatePixmapProcPtr)(
  159. ScreenPtr /*pScreen*/,
  160. int /*width*/,
  161. int /*height*/,
  162. int /*depth*/);
  163. typedef Bool (* DestroyPixmapProcPtr)(
  164. PixmapPtr /*pPixmap*/);
  165. typedef Bool (* RealizeFontProcPtr)(
  166. ScreenPtr /*pScreen*/,
  167. FontPtr /*pFont*/);
  168. typedef Bool (* UnrealizeFontProcPtr)(
  169. ScreenPtr /*pScreen*/,
  170. FontPtr /*pFont*/);
  171. typedef void (* ConstrainCursorProcPtr)(
  172. ScreenPtr /*pScreen*/,
  173. BoxPtr /*pBox*/);
  174. typedef void (* CursorLimitsProcPtr)(
  175. ScreenPtr /*pScreen*/,
  176. CursorPtr /*pCursor*/,
  177. BoxPtr /*pHotBox*/,
  178. BoxPtr /*pTopLeftBox*/);
  179. typedef Bool (* DisplayCursorProcPtr)(
  180. ScreenPtr /*pScreen*/,
  181. CursorPtr /*pCursor*/);
  182. typedef Bool (* RealizeCursorProcPtr)(
  183. ScreenPtr /*pScreen*/,
  184. CursorPtr /*pCursor*/);
  185. typedef Bool (* UnrealizeCursorProcPtr)(
  186. ScreenPtr /*pScreen*/,
  187. CursorPtr /*pCursor*/);
  188. typedef void (* RecolorCursorProcPtr)(
  189. ScreenPtr /*pScreen*/,
  190. CursorPtr /*pCursor*/,
  191. Bool /*displayed*/);
  192. typedef Bool (* SetCursorPositionProcPtr)(
  193. ScreenPtr /*pScreen*/,
  194. int /*x*/,
  195. int /*y*/,
  196. Bool /*generateEvent*/);
  197. typedef Bool (* CreateGCProcPtr)(
  198. GCPtr /*pGC*/);
  199. typedef Bool (* CreateColormapProcPtr)(
  200. ColormapPtr /*pColormap*/);
  201. typedef void (* DestroyColormapProcPtr)(
  202. ColormapPtr /*pColormap*/);
  203. typedef void (* InstallColormapProcPtr)(
  204. ColormapPtr /*pColormap*/);
  205. typedef void (* UninstallColormapProcPtr)(
  206. ColormapPtr /*pColormap*/);
  207. typedef int (* ListInstalledColormapsProcPtr) (
  208. ScreenPtr /*pScreen*/,
  209. XID* /*pmaps */);
  210. typedef void (* StoreColorsProcPtr)(
  211. ColormapPtr /*pColormap*/,
  212. int /*ndef*/,
  213. xColorItem * /*pdef*/);
  214. typedef void (* ResolveColorProcPtr)(
  215. unsigned short* /*pred*/,
  216. unsigned short* /*pgreen*/,
  217. unsigned short* /*pblue*/,
  218. VisualPtr /*pVisual*/);
  219. typedef RegionPtr (* BitmapToRegionProcPtr)(
  220. PixmapPtr /*pPix*/);
  221. typedef void (* SendGraphicsExposeProcPtr)(
  222. ClientPtr /*client*/,
  223. RegionPtr /*pRgn*/,
  224. XID /*drawable*/,
  225. int /*major*/,
  226. int /*minor*/);
  227. typedef void (* ScreenBlockHandlerProcPtr)(
  228. int /*screenNum*/,
  229. pointer /*blockData*/,
  230. pointer /*pTimeout*/,
  231. pointer /*pReadmask*/);
  232. typedef void (* ScreenWakeupHandlerProcPtr)(
  233. int /*screenNum*/,
  234. pointer /*wakeupData*/,
  235. unsigned long /*result*/,
  236. pointer /*pReadMask*/);
  237. typedef Bool (* CreateScreenResourcesProcPtr)(
  238. ScreenPtr /*pScreen*/);
  239. typedef Bool (* ModifyPixmapHeaderProcPtr)(
  240. PixmapPtr /*pPixmap*/,
  241. int /*width*/,
  242. int /*height*/,
  243. int /*depth*/,
  244. int /*bitsPerPixel*/,
  245. int /*devKind*/,
  246. pointer /*pPixData*/);
  247. typedef PixmapPtr (* GetWindowPixmapProcPtr)(
  248. WindowPtr /*pWin*/);
  249. typedef void (* SetWindowPixmapProcPtr)(
  250. WindowPtr /*pWin*/,
  251. PixmapPtr /*pPix*/);
  252. typedef PixmapPtr (* GetScreenPixmapProcPtr)(
  253. ScreenPtr /*pScreen*/);
  254. typedef void (* SetScreenPixmapProcPtr)(
  255. PixmapPtr /*pPix*/);
  256. typedef void (* MarkWindowProcPtr)(
  257. WindowPtr /*pWin*/);
  258. typedef Bool (* MarkOverlappedWindowsProcPtr)(
  259. WindowPtr /*parent*/,
  260. WindowPtr /*firstChild*/,
  261. WindowPtr * /*pLayerWin*/);
  262. typedef void (* MoveWindowProcPtr)(
  263. WindowPtr /*pWin*/,
  264. int /*x*/,
  265. int /*y*/,
  266. WindowPtr /*pSib*/,
  267. VTKind /*kind*/);
  268. typedef void (* ResizeWindowProcPtr)(
  269. WindowPtr /*pWin*/,
  270. int /*x*/,
  271. int /*y*/,
  272. unsigned int /*w*/,
  273. unsigned int /*h*/,
  274. WindowPtr /*pSib*/
  275. );
  276. typedef WindowPtr (* GetLayerWindowProcPtr)(
  277. WindowPtr /*pWin*/
  278. );
  279. typedef void (* HandleExposuresProcPtr)(
  280. WindowPtr /*pWin*/);
  281. typedef void (* ReparentWindowProcPtr)(
  282. WindowPtr /*pWin*/,
  283. WindowPtr /*pPriorParent*/);
  284. typedef void (* SetShapeProcPtr)(
  285. WindowPtr /*pWin*/);
  286. typedef void (* ChangeBorderWidthProcPtr)(
  287. WindowPtr /*pWin*/,
  288. unsigned int /*width*/);
  289. typedef void (* MarkUnrealizedWindowProcPtr)(
  290. WindowPtr /*pChild*/,
  291. WindowPtr /*pWin*/,
  292. Bool /*fromConfigure*/);
  293. typedef struct _Screen {
  294. int myNum; /* index of this instance in Screens[] */
  295. ATOM id;
  296. short width, height;
  297. short mmWidth, mmHeight;
  298. short numDepths;
  299. unsigned char rootDepth;
  300. DepthPtr allowedDepths;
  301. unsigned long rootVisual;
  302. unsigned long defColormap;
  303. short minInstalledCmaps, maxInstalledCmaps;
  304. char backingStoreSupport, saveUnderSupport;
  305. unsigned long whitePixel, blackPixel;
  306. unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
  307. GCPtr GCperDepth[MAXFORMATS+1];
  308. /* next field is a stipple to use as default in
  309. a GC. we don't build default tiles of all depths
  310. because they are likely to be of a color
  311. different from the default fg pixel, so
  312. we don't win anything by building
  313. a standard one.
  314. */
  315. PixmapPtr PixmapPerDepth[1];
  316. pointer devPrivate;
  317. short numVisuals;
  318. VisualPtr visuals;
  319. int WindowPrivateLen;
  320. unsigned *WindowPrivateSizes;
  321. unsigned totalWindowSize;
  322. int GCPrivateLen;
  323. unsigned *GCPrivateSizes;
  324. unsigned totalGCSize;
  325. /* Random screen procedures */
  326. CloseScreenProcPtr CloseScreen;
  327. QueryBestSizeProcPtr QueryBestSize;
  328. SaveScreenProcPtr SaveScreen;
  329. GetImageProcPtr GetImage;
  330. GetSpansProcPtr GetSpans;
  331. PointerNonInterestBoxProcPtr PointerNonInterestBox;
  332. SourceValidateProcPtr SourceValidate;
  333. /* Window Procedures */
  334. CreateWindowProcPtr CreateWindow;
  335. DestroyWindowProcPtr DestroyWindow;
  336. PositionWindowProcPtr PositionWindow;
  337. ChangeWindowAttributesProcPtr ChangeWindowAttributes;
  338. RealizeWindowProcPtr RealizeWindow;
  339. UnrealizeWindowProcPtr UnrealizeWindow;
  340. ValidateTreeProcPtr ValidateTree;
  341. PostValidateTreeProcPtr PostValidateTree;
  342. WindowExposuresProcPtr WindowExposures;
  343. PaintWindowBackgroundProcPtr PaintWindowBackground;
  344. PaintWindowBorderProcPtr PaintWindowBorder;
  345. CopyWindowProcPtr CopyWindow;
  346. ClearToBackgroundProcPtr ClearToBackground;
  347. ClipNotifyProcPtr ClipNotify;
  348. RestackWindowProcPtr RestackWindow;
  349. /* Pixmap procedures */
  350. CreatePixmapProcPtr CreatePixmap;
  351. DestroyPixmapProcPtr DestroyPixmap;
  352. /* Font procedures */
  353. RealizeFontProcPtr RealizeFont;
  354. UnrealizeFontProcPtr UnrealizeFont;
  355. /* Cursor Procedures */
  356. ConstrainCursorProcPtr ConstrainCursor;
  357. CursorLimitsProcPtr CursorLimits;
  358. DisplayCursorProcPtr DisplayCursor;
  359. RealizeCursorProcPtr RealizeCursor;
  360. UnrealizeCursorProcPtr UnrealizeCursor;
  361. RecolorCursorProcPtr RecolorCursor;
  362. SetCursorPositionProcPtr SetCursorPosition;
  363. /* GC procedures */
  364. CreateGCProcPtr CreateGC;
  365. /* Colormap procedures */
  366. CreateColormapProcPtr CreateColormap;
  367. DestroyColormapProcPtr DestroyColormap;
  368. InstallColormapProcPtr InstallColormap;
  369. UninstallColormapProcPtr UninstallColormap;
  370. ListInstalledColormapsProcPtr ListInstalledColormaps;
  371. StoreColorsProcPtr StoreColors;
  372. ResolveColorProcPtr ResolveColor;
  373. /* Region procedures */
  374. BitmapToRegionProcPtr BitmapToRegion;
  375. SendGraphicsExposeProcPtr SendGraphicsExpose;
  376. /* os layer procedures */
  377. ScreenBlockHandlerProcPtr BlockHandler;
  378. ScreenWakeupHandlerProcPtr WakeupHandler;
  379. pointer blockData;
  380. pointer wakeupData;
  381. /* anybody can get a piece of this array */
  382. DevUnion *devPrivates;
  383. CreateScreenResourcesProcPtr CreateScreenResources;
  384. ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
  385. GetWindowPixmapProcPtr GetWindowPixmap;
  386. SetWindowPixmapProcPtr SetWindowPixmap;
  387. GetScreenPixmapProcPtr GetScreenPixmap;
  388. SetScreenPixmapProcPtr SetScreenPixmap;
  389. PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
  390. int PixmapPrivateLen;
  391. unsigned int *PixmapPrivateSizes;
  392. unsigned int totalPixmapSize;
  393. MarkWindowProcPtr MarkWindow;
  394. MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
  395. MoveWindowProcPtr MoveWindow;
  396. ResizeWindowProcPtr ResizeWindow;
  397. GetLayerWindowProcPtr GetLayerWindow;
  398. HandleExposuresProcPtr HandleExposures;
  399. ReparentWindowProcPtr ReparentWindow;
  400. SetShapeProcPtr SetShape;
  401. ChangeBorderWidthProcPtr ChangeBorderWidth;
  402. MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
  403. } ScreenRec;
  404. typedef struct _ScreenInfo {
  405. int imageByteOrder;
  406. int bitmapScanlineUnit;
  407. int bitmapScanlinePad;
  408. int bitmapBitOrder;
  409. int numPixmapFormats;
  410. PixmapFormatRec
  411. formats[MAXFORMATS];
  412. int numScreens;
  413. ScreenPtr screens[MAXSCREENS];
  414. } ScreenInfo;
  415. extern ScreenInfo screenInfo;
  416. void InitOutput(
  417. ScreenInfo * /*pScreenInfo*/,
  418. int /*argc*/,
  419. char ** /*argv*/);
  420. #endif /* SCREENINTSTRUCT_H */