home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / dec / qdss / qdwindow.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-19  |  3.2 KB  |  132 lines

  1. /***********************************************************
  2. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  3. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its 
  8. documentation for any purpose and without fee is hereby granted, 
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in 
  11. supporting documentation, and that the names of Digital or MIT not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.  
  14.  
  15. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  16. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  17. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  18. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  20. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21. SOFTWARE.
  22.  
  23. ******************************************************************/
  24.  
  25. #include "X.h"
  26. #include "windowstr.h"
  27. #include "qd.h"
  28. #include "gcstruct.h"
  29. #include "scrnintstr.h"
  30. #include "regionstr.h"
  31. #include "mi.h"
  32.  
  33. extern WindowPtr *WindowTable;
  34.  
  35. Bool
  36. qdDestroyWindow(pWin)
  37. WindowPtr pWin;
  38. {
  39.     return (TRUE);
  40. }
  41.  
  42. Bool
  43. qdChangeWindowAttributes(pWin, mask)
  44.     register WindowPtr pWin;
  45.     register int mask;
  46. {
  47.     return TRUE;
  48. }
  49.  
  50. Bool
  51. qdMapWindow(pWindow)
  52. WindowPtr pWindow;
  53. {
  54. }
  55.  
  56. Bool
  57. qdUnmapWindow(pWindow, x, y)
  58. WindowPtr pWindow;
  59. int x, y;
  60. {
  61. }
  62.  
  63. Bool
  64. qdPositionWindow(pWindow)
  65. WindowPtr pWindow;
  66. {
  67. }
  68.  
  69. extern    int    Nplanes;
  70.  
  71. /*
  72.  * DDX CopyWindow is required to translate prgnSrc by
  73.  * pWin->absCorner - ptOldOrg .
  74.  *
  75.  * This change appears to have been made by MIT.  -dwm
  76.  */
  77. void
  78. qdCopyWindow(pWin, ptOldOrg, prgnSrc)
  79.     WindowPtr pWin;
  80.     DDXPointRec ptOldOrg;
  81.     RegionPtr prgnSrc;
  82. {
  83.     GCPtr pcopyGC;
  84.     WindowPtr pwinRoot;
  85.     ScreenPtr pScreen;
  86.     int               dx, dy;
  87.     BoxRec    box;    
  88.     RegionPtr    clientClip;
  89.     int        n;
  90.     int        x, y, w, h;
  91.     int        sx, sy;
  92.     XID        subwindowMode = IncludeInferiors;
  93.  
  94.     dx = QDWIN_X(pWin) - ptOldOrg.x;
  95.     dy = QDWIN_Y(pWin) - ptOldOrg.y;
  96.     pScreen = pWin->drawable.pScreen;
  97.     pwinRoot = WindowTable[pScreen->myNum];
  98.  
  99.     (*pScreen->TranslateRegion) (prgnSrc, dx, dy);
  100.  
  101.     pcopyGC = GetScratchGC( Nplanes, pScreen);
  102.     DoChangeGC( pcopyGC, GCSubwindowMode, &subwindowMode, 0);
  103.  
  104.     clientClip = (*pScreen->RegionCreate) (NULL, 1);
  105.     (*pScreen->Intersect) (clientClip, &pWin->borderClip, prgnSrc);
  106.     box = * (*pScreen->RegionExtents) (clientClip);
  107.     qdChangeClip(pcopyGC, CT_REGION, (pointer) clientClip, 0);
  108.  
  109.     ValidateGC( pwinRoot, pcopyGC);
  110.  
  111.     x = box.x1;
  112.     y = box.y1;
  113.     w = ((int) box.x2) - x;
  114.     h = ((int) box.y2) - y;
  115.     sx = x - dx;
  116.     sy = y - dy;
  117.  
  118.     qdCopyAreaWin(pwinRoot, pwinRoot, pcopyGC, sx, sy, w, h, x, y);
  119.     (*pwinRoot->drawable.pScreen->BlockHandler) ();
  120.     qdChangeClip(pcopyGC, CT_NONE, (pointer) NULL, 0);
  121.  
  122.     FreeScratchGC( pcopyGC);
  123. }
  124.  
  125.  
  126. Bool
  127. qdCreateWindow(pWin)
  128. WindowPtr pWin;
  129. {
  130.     return TRUE;
  131. }
  132.