/Xext/panoramiXSwap.c

https://gitlab.com/Manizuca/xserver · C · 133 lines · 94 code · 15 blank · 24 comment · 1 complexity · e460169e942d7b90cf1da904cda03ecc MD5 · raw file

  1. /*****************************************************************
  2. Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software.
  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
  13. DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
  14. BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
  15. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
  16. IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. Except as contained in this notice, the name of Digital Equipment Corporation
  18. shall not be used in advertising or otherwise to promote the sale, use or other
  19. dealings in this Software without prior written authorization from Digital
  20. Equipment Corporation.
  21. ******************************************************************/
  22. #ifdef HAVE_DIX_CONFIG_H
  23. #include <dix-config.h>
  24. #endif
  25. #include <stdio.h>
  26. #include <X11/X.h>
  27. #include <X11/Xproto.h>
  28. #include "misc.h"
  29. #include "cursor.h"
  30. #include "cursorstr.h"
  31. #include "extnsionst.h"
  32. #include "dixstruct.h"
  33. #include "gc.h"
  34. #include "gcstruct.h"
  35. #include "scrnintstr.h"
  36. #include "window.h"
  37. #include "windowstr.h"
  38. #include "pixmapstr.h"
  39. #include "panoramiX.h"
  40. #include <X11/extensions/panoramiXproto.h>
  41. #include "panoramiXsrv.h"
  42. #include "globals.h"
  43. #include "panoramiXh.h"
  44. static int
  45. SProcPanoramiXQueryVersion(ClientPtr client)
  46. {
  47. REQUEST(xPanoramiXQueryVersionReq);
  48. swaps(&stuff->length);
  49. REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
  50. return ProcPanoramiXQueryVersion(client);
  51. }
  52. static int
  53. SProcPanoramiXGetState(ClientPtr client)
  54. {
  55. REQUEST(xPanoramiXGetStateReq);
  56. swaps(&stuff->length);
  57. REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
  58. swapl(&stuff->window);
  59. return ProcPanoramiXGetState(client);
  60. }
  61. static int
  62. SProcPanoramiXGetScreenCount(ClientPtr client)
  63. {
  64. REQUEST(xPanoramiXGetScreenCountReq);
  65. swaps(&stuff->length);
  66. REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
  67. swapl(&stuff->window);
  68. return ProcPanoramiXGetScreenCount(client);
  69. }
  70. static int
  71. SProcPanoramiXGetScreenSize(ClientPtr client)
  72. {
  73. REQUEST(xPanoramiXGetScreenSizeReq);
  74. swaps(&stuff->length);
  75. REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
  76. swapl(&stuff->window);
  77. swapl(&stuff->screen);
  78. return ProcPanoramiXGetScreenSize(client);
  79. }
  80. static int
  81. SProcXineramaIsActive(ClientPtr client)
  82. {
  83. REQUEST(xXineramaIsActiveReq);
  84. swaps(&stuff->length);
  85. REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
  86. return ProcXineramaIsActive(client);
  87. }
  88. static int
  89. SProcXineramaQueryScreens(ClientPtr client)
  90. {
  91. REQUEST(xXineramaQueryScreensReq);
  92. swaps(&stuff->length);
  93. REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
  94. return ProcXineramaQueryScreens(client);
  95. }
  96. int
  97. SProcPanoramiXDispatch(ClientPtr client)
  98. {
  99. REQUEST(xReq);
  100. switch (stuff->data) {
  101. case X_PanoramiXQueryVersion:
  102. return SProcPanoramiXQueryVersion(client);
  103. case X_PanoramiXGetState:
  104. return SProcPanoramiXGetState(client);
  105. case X_PanoramiXGetScreenCount:
  106. return SProcPanoramiXGetScreenCount(client);
  107. case X_PanoramiXGetScreenSize:
  108. return SProcPanoramiXGetScreenSize(client);
  109. case X_XineramaIsActive:
  110. return SProcXineramaIsActive(client);
  111. case X_XineramaQueryScreens:
  112. return SProcXineramaQueryScreens(client);
  113. }
  114. return BadRequest;
  115. }