home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / ppc / ppcIO.c < prev    next >
C/C++ Source or Header  |  1992-02-11  |  7KB  |  199 lines

  1. /*
  2.  * Copyright IBM Corporation 1987,1988,1989
  3.  *
  4.  * All Rights Reserved
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted,
  8.  * provided that the above copyright notice appear in all copies and that 
  9.  * both that copyright notice and this permission notice appear in
  10.  * supporting documentation, and that the name of IBM not be
  11.  * used in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20.  * SOFTWARE.
  21.  *
  22. */
  23. /***********************************************************
  24.         Copyright IBM Corporation 1987,1988
  25.  
  26.                       All Rights Reserved
  27.  
  28. Permission to use, copy, modify, and distribute this software and its 
  29. documentation for any purpose and without fee is hereby granted, 
  30. provided that the above copyright notice appear in all copies and that
  31. both that copyright notice and this permission notice appear in 
  32. supporting documentation, and that the name of IBM not be
  33. used in advertising or publicity pertaining to distribution of the
  34. software without specific, written prior permission.  
  35.  
  36. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  37. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  38. IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  39. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  40. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  41. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  42. SOFTWARE.
  43.  
  44. ******************************************************************/
  45. /***********************************************************
  46. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  47. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  48.  
  49.                 All Rights Reserved
  50.  
  51. Permission to use, copy, modify, and distribute this software and its 
  52. documentation for any purpose and without fee is hereby granted, 
  53. provided that the above copyright notice appear in all copies and that
  54. both that copyright notice and this permission notice appear in 
  55. supporting documentation, and that the names of Digital or MIT not be
  56. used in advertising or publicity pertaining to distribution of the
  57. software without specific, written prior permission.  
  58.  
  59. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  60. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  61. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  62. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  63. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  64. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  65. SOFTWARE.
  66.  
  67. ******************************************************************/
  68.  
  69. /* $Header: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/ppc/RCS/ppcIO.c,v 5.2 1992/02/12 00:29:47 jfc Exp $ */
  70. /* $Source: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/ppc/RCS/ppcIO.c,v $ */
  71.  
  72. #ifndef lint
  73. static char *rcsid = "$Id: ppcIO.c,v 5.2 1992/02/12 00:29:47 jfc Exp $" ;
  74. #endif
  75.  
  76. #include "X.h"
  77. #include "Xproto.h"
  78. #include "resource.h"
  79. #include "servermd.h"
  80. #include "scrnintstr.h"
  81. #include "window.h"
  82. #include "font.h"
  83. #include "miscstruct.h"
  84. #include "colormap.h"
  85. #include "colormapst.h"
  86. #include "cursorstr.h"
  87. #include "pixmapstr.h"
  88. #include "mistruct.h"
  89. #include "mibstore.h"
  90.  
  91. #include "OScompiler.h"
  92. #include "ibmScreen.h"
  93. #ifdef AIXrt
  94. #include "OSio.h"
  95. #endif
  96. #include "OScursor.h"
  97.  
  98. #include "ppc.h"
  99. #include "ppcProcs.h"
  100.  
  101. #include "ibmTrace.h"
  102.  
  103. miBSFuncRec ppcBSFuncRec = {
  104.     ppcSaveAreas,
  105.     ppcRestoreAreas,
  106.     (void (*)()) 0,
  107.     (PixmapPtr (*)()) 0,
  108.     (PixmapPtr (*)()) 0,
  109. };
  110.  
  111. static void
  112. ppcDoNaught()
  113. {
  114. return ;
  115. }
  116.  
  117. void
  118. ppcCommonScreenInit( pScreen, index, pScrnProto )
  119. register ScreenPtr const pScreen ;
  120. register const int index ;
  121. ScreenPtr const pScrnProto ;
  122. {
  123.     register int i ;
  124.     VisualPtr pVis ;
  125.     ppcScrnPriv *pScrnPriv ;
  126.     int savemyNum = pScreen->myNum;
  127.     int saveWindowPrivateLen = pScreen->WindowPrivateLen;
  128.     unsigned *saveWindowPrivateSizes = pScreen->WindowPrivateSizes;
  129.     unsigned savetotalWindowSize = pScreen->totalWindowSize;
  130.     int saveGCPrivateLen = pScreen->GCPrivateLen;
  131.     unsigned *saveGCPrivateSizes = pScreen->GCPrivateSizes;
  132.     unsigned savetotalGCSize = pScreen->totalGCSize;
  133.     DevUnion *savedevPrivates = pScreen->devPrivates;
  134.  
  135.     TRACE( ( "ppcCommonScreenInit(pScreen=0x%x,index=%d,pScrnProto=0x%x)\n",
  136.         pScreen, index, pScrnProto ) ) ;
  137.  
  138.     *pScreen = *pScrnProto ; /* Copy The Prototype Structure */
  139.  
  140.     pScreen->devPrivates = savedevPrivates;
  141.     pScreen->myNum = savemyNum;
  142.     pScreen->WindowPrivateLen = saveWindowPrivateLen;
  143.     pScreen->WindowPrivateSizes = saveWindowPrivateSizes;
  144.     pScreen->totalWindowSize = savetotalWindowSize;
  145.     pScreen->GCPrivateLen = saveGCPrivateLen;
  146.     pScreen->GCPrivateSizes = saveGCPrivateSizes;
  147.     pScreen->totalGCSize = savetotalGCSize;
  148.  
  149.     if (!mfbAllocatePrivates(pScreen, (int*)NULL, (int*)NULL))
  150.         return ;
  151.  
  152.     pScrnPriv = (ppcScrnPriv *) ( pScreen->devPrivate ) ;
  153.     ibmScreen( pScreen->myNum = index ) =
  154.     pScrnPriv->devPrototypeGC->pScreen =
  155.     pScrnPriv->pixmap.drawable.pScreen =
  156.     pScreen ;
  157.  
  158.     /* Set up the visuals */
  159.     pVis = pScrnProto->visuals ;
  160.  
  161.     { /* Set The Standard Colormap Stuff */
  162.         ColormapPtr pColormap ;
  163.  
  164.         /* "dix" Colormap Stuff */
  165.         CreateColormap( pScreen->defColormap =
  166.                 (Colormap) FakeClientID( 0 ),
  167.                 pScreen, pVis, &pColormap, AllocNone, 0 ) ;
  168.         pColormap->pScreen = pScreen ;
  169.  
  170.         /* "ppc" Colormap Stuff */
  171.         ibmDefineDefaultColormapColors( pVis, pColormap ) ;
  172.         (*pScreen->InstallColormap)(pColormap);
  173.         ibmAllocBlackAndWhitePixels(pColormap);
  174.     }
  175. #ifdef AIXrt
  176.     pScreen->BlockHandler = OS_BlockHandler;
  177.     pScreen->WakeupHandler = OS_WakeupHandler;
  178. #endif
  179.     miInitializeBackingStore (pScreen, &ppcBSFuncRec);
  180.     TRACE(("ppcCommonScreenInit returns\n"));
  181.     return ;
  182. }
  183.  
  184. /*ARGSUSED*/
  185. void
  186. ppcCommonScreenClose( pScreen, index, pScrnProto )
  187. register ScreenPtr const pScreen ;
  188. register const int index ;
  189. ScreenPtr const pScrnProto ;
  190. {
  191. /*
  192.     FreeColormap( pScreen->defColormap ) ;
  193. */
  194.     pScreen->defColormap = 0 ;
  195.     ( (ppcScrnPriv *) pScreen->devPrivate )->InstalledColormap =
  196.         (ColormapPtr) 0 ;
  197.     return ;
  198. }
  199.