home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / dec / mfbpmax / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-27  |  2.8 KB  |  94 lines

  1. /***********************************************************
  2. Copyright 1987 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. /* $XConsortium: init.c,v 1.5 91/01/27 13:06:31 keith Exp $ */
  26.  
  27. #include "X.h"
  28. #include "Xproto.h"
  29. #include <sys/types.h>
  30.  
  31. #include "scrnintstr.h"
  32. #include "servermd.h"
  33. #include "input.h"
  34.  
  35. /*
  36.  * The contents of this file are not just dependent upon the pmax b/w display,
  37.  * but describe the configuration of the entire server.
  38.  *
  39.  * There is an init file for each possible configuration of a server. This
  40.  * is the one for a server that has nothing but an pm hooked to it.
  41.  */
  42.  
  43. extern Bool pmScreenInit();
  44. extern void pmMouseProc();
  45. extern void pmKeybdProc();
  46.  
  47. #define NUMFORMATS 1
  48. static    PixmapFormatRec formats[] = {{1, 1, BITMAP_SCANLINE_PAD}};
  49.  
  50. InitOutput(screenInfo, argc, argv)
  51.     ScreenInfo *screenInfo;
  52.     int argc;
  53.     char **argv;
  54. {
  55.     int i;
  56.  
  57.     int        imageByteOrder;
  58.     int        bitmapScanlineUnit;
  59.     int        bitmapScanlinePad;
  60.     int        bitmapBitOrder;
  61.     int        numPixmapFormats;
  62.  
  63.     screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
  64.     screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
  65.     screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
  66.     screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
  67.  
  68.     screenInfo->numPixmapFormats = NUMFORMATS;
  69.     for (i=0; i< NUMFORMATS; i++)
  70.     {
  71.     screenInfo->formats[i].depth = formats[i].depth;
  72.     screenInfo->formats[i].bitsPerPixel = formats[i].bitsPerPixel;
  73.     screenInfo->formats[i].scanlinePad = formats[i].scanlinePad;
  74.     }
  75.  
  76.     AddScreen(pmScreenInit, argc, argv);
  77.  
  78. }
  79.  
  80. void
  81. InitInput(argc, argv)
  82.     int argc;
  83.     char *argv[];
  84. {
  85.     DevicePtr p, k;
  86.     
  87.     p = AddInputDevice(pmMouseProc, TRUE);
  88.  
  89.     k = AddInputDevice(pmKeybdProc, TRUE);
  90.  
  91.     RegisterPointerDevice(p);
  92.     RegisterKeyboardDevice(k);
  93. }
  94.