home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / tek / svc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-26  |  7.7 KB  |  261 lines

  1. /***********************************************************
  2. Copyright 1987 by Tektronix, Beaverton, Oregon,
  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 Tektronix or MIT not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.
  14.  
  15. TEKTRONIX 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.  * This file contains...
  26.  *    .    Function codes for Display Supervisor Vector Calls.
  27.  *
  28.  *    .    getMachineType definitions.
  29.  *
  30.  *    .    4316/7 color SVC structures definitions for the cursor forms passed
  31.  *    from the user.
  32.  *
  33.  *    .    4316/7 color SVC structures definitions for the color maps passed from
  34.  *    the user.
  35.  */
  36. #ifndef LINT
  37. #ifdef RCS_ID
  38. static char *rcsid=  "$Header: svc.h,v 1.1 89/09/30 18:53:02 keith Exp $";
  39. #endif /* RCS_ID */
  40. #endif /* LINT */
  41. #ifndef SVC_H
  42. #define SVC_H
  43.  
  44. #ifdef ASSEMBLER
  45. /*
  46.  * The magic number for Display System Calls
  47.  * ( assembly langauge instruction "Trap #13" )
  48.  */
  49. #define    DisplayTrapNumber    13    
  50.  
  51. /*
  52.  * Function codes for Display Supervisor Vector Calls.
  53.  *
  54.  * 00 - 35 are for Standard display system support.  36 - 39 are reserved.
  55.  */
  56. #define    cursorOn        0
  57. #define    cursorOff        1
  58. #define    cursorLink        2
  59. #define    cursorUnlink        3
  60. #define    cursorPanOn        4
  61. #define    cursorPanOff        5
  62. #define    displayOn        6
  63. #define    displayOff        7
  64. #define    joyPanOn        8
  65. #define    joyPanOff        9    
  66. #define    timeoutOn        10
  67. #define    timeoutOff        11
  68. #define    blackOnWhite        12
  69. #define    whiteOnBlack        13
  70. #define    terminalOn        14
  71. #define    terminalOff        15
  72. #define    getMousePoint        16
  73. #define    setMousePoint        17
  74. #define    getCursorPoint        18
  75. #define    setCursorPoint        19
  76. #define    getButtons        20
  77. #define    setSource        21
  78. #define    setDest            22
  79. #define    updateComplete        23
  80. #define    getCursorForm        24
  81. #define    setCursorForm        25
  82. #define    getViewport        26
  83. #define    setViewport        27
  84. #define    getDisplayState        28
  85. #define    setKeyboardCode         29
  86. #define    getMouseBounds         30
  87. #define    setMouseBounds         31
  88. #define    XYtoRC             32
  89. #define    RCtoXY             33
  90. #define    setCursorOffset        34
  91. #define    getCursorOffset        35
  92. #define    setCursorSpeed      36
  93.  
  94. /*
  95.  * 40 - 49 are for Standard display system "events" support
  96.  */
  97. #define    eventsEnable        40
  98. #define    eventsDisable        41
  99. #define    eventSignalOn        42
  100. #define    eventMouseInterval     43
  101. #define    getEventCount        44
  102. #define    getNewEventCount     45 
  103. #define    getNextEvent        46
  104. #define    getMillisecondTime     47
  105. #define    setAlarmTime        48
  106. #define    clearAlarm        49
  107.  
  108. /*
  109.  * 50 - 55 are for 4316/4317 color/gray operations.
  110.  */
  111. #define    setCursorSourceAndMask  50
  112. #define    getCursorSourceAndMask  51
  113. #define    setCrosshairCursor     52
  114. #define    getCrosshairCursor     53
  115. #define    setCursorMode        54
  116. #define    getCursorMode        55
  117.  
  118. /*
  119.  * 59 is reserved.
  120.  *
  121.  * putAnEventCode       59    put a RAW keycode into the event queue.(debug)
  122.  */
  123.  
  124. /*
  125.  * 63 - 69 are for 4316/7 color/gray operations.
  126.  */
  127. #define    setCursorColor            63
  128. #define    getCursorColor            64
  129. #define    setColorMap            65
  130. #define    getColorMap            66
  131. #define    setGrayMap            67
  132. #define    getGrayMap            68
  133. #define    getColorEntry            69
  134. #define    getGrayEntry            70
  135. #define    lockDisplay            71
  136. #define    unlockDisplay            72
  137. #define    lockColorMap            73
  138. #define    unlockColorMap            74
  139.  
  140. /*
  141.  * 75 - 77 are get/set machine type
  142.  */
  143. #define    getMachineType            75
  144. #define    setMachineType            76
  145. #define    getRealMachineType        77
  146.  
  147. /*
  148.  * and the tail end...
  149.  */
  150. #define    lastDisplaySVCcode        90
  151.  
  152. #else /* ASSEMBLER */
  153.  
  154. /*
  155.  * _svcCursorXY also declared in /usr/include/box/display.h
  156.  */
  157. #ifndef DISPLAY_H
  158. typedef struct _svcCursorXY {
  159.     short x, y;
  160. } SvcCursorXY, *SvcCursorXYPtr;
  161. #endif  /* DISPLAY_H */
  162.  
  163. /*
  164.  * The get/set Machine type calls support the 440x (UniFLEX) and 440x+ (UTek)
  165.  * systems. The "Real" machine type cannot be changed. The get/set machine type
  166.  * may be manipulated to target software characteristics to multiple platforms.
  167.  */
  168. typedef struct _svcMachineType {
  169.     long    model:16;        /* can be 0x4404, 0x4405, 0x4406, */
  170.                     /* 0x4316, 0x4317
  171.     long    plus:1;            /* True if this is a UTek + series */
  172.     long    cdp:1;            /* True if CDP hardware is present */
  173.     long    color:1;        /* True if color, b&w otherwise */
  174. } SvcMachineType, *SvcMachineTypePtr;
  175. extern SvcMachineType GetSvcMachineType();
  176.  
  177. typedef struct _svcCursorSpeed {
  178.         short threshold;
  179.         short multiplier;
  180.         short divisor;
  181. } SvcCursorSpeed, *SvcCursorSpeedPtr;
  182.  
  183. /*
  184.  * Display state record returned by getDisplayState system call
  185.  */
  186. typedef struct _svcDisplayState {
  187.     long    reservedA:15;
  188.     long    eventsOn:1;    /* true if event mechanism is on */
  189.     long    reservedB:4;
  190.     long    discPanOn:1;    /* true if joydisk causes viewport panning */
  191.     long    cursorPanOn:1;    /* true if cursor can cause viewport panning */
  192.     long    mouseLinked:1;    /* true if mouse is linked to cursor */
  193.     long    cursorOn:1;    /* true if graphics cursor is enabled */
  194.     long    reservedC:3;
  195.     long    lockLedOn:1;    /* true if caps lock LED is illuminated */
  196.     long    emulatorOn:1;    /* true if terminal emulator output enabled */
  197.     long    blackOnWhite:1;    /* true if black on white, w on b otherwise */
  198.     long    screenSaver:1;    /* true if screen save is active */
  199.     long    displayOn:1;    /* true if on */
  200.     long    viewport;    /* upper left corner point of viewport */
  201.     long    mouseBound_ul;    /* upper left corner point of mouse bounds */
  202.     long    mouseBound_lr;    /* lower right corner point of mouse bounds */
  203.     short    cursor[ 16 ];    /* cursor image */
  204.     char    keyboardCode;    /* current keyboard encoding 0=events 1=ansi */
  205.     char    reserved1;    /* reserved for future use
  206.     short    lineIncrement;    /* number of bytes from between lines */
  207.     short    width;        /* width of virtual display bitmap */
  208.     short    height;        /* height of virtual display bitmap */
  209.     short    viewPortWidth;    /* width of viewport */
  210.     short    viewPortHeight;    /* height of viewport */
  211.     SvcCursorXY cursorOffset; /* X and Y graphic cursor offset */
  212.     long    reservedD[2];    /* reserved for future use */
  213. } SvcDisplayState, *SvcDisplayStatePtr;
  214. extern SvcDisplayState *GetDisplayState();
  215.     
  216. /*
  217.  * structure for setting RGB cursor values.
  218.  */
  219. typedef struct _svcCursorColor {
  220.     unsigned short    redFore;    /* RED value for cursor foreground */
  221.     unsigned short    greenFore;    /* GREEN value "" "" */
  222.     unsigned short    blueFore;    /* BLUE value  "" "" */
  223.     unsigned short    redBack;    /* RED value for cursor background */
  224.     unsigned short    greenBack;    /* GREEN value "" "" */
  225.     unsigned short    blueBack;    /* BLUE value  "" "" */
  226. } SvcCursorColor, *SvcCursorColorPtr;
  227. extern int SetCursorColor(),
  228.        GetCursorColor();
  229.  
  230. /*
  231.  * Cursor size required by SVC
  232.  * Number of longs needed to store cursor data required by SVC (64x64/32)
  233.  */
  234. #define SvcCursorSize 64
  235. #define SvcCursorDataSize 128
  236.  
  237. /*
  238.  * structure used by the svc for set/get CursorSourceAndMask display
  239.  * system calls expect/return this structure.
  240.  */
  241. typedef struct _svcCursorForm {
  242.         short xoff, yoff;
  243.     unsigned long *src;
  244.     unsigned long *mask;
  245. } SvcCursorForm, *SvcCursorFormPtr;
  246. extern int SetCursorSourceAndMask(),
  247.        GetCursorSourceAndMask();
  248.  
  249. /*
  250.  * color map structure
  251.  */
  252. typedef struct _svcColorDef {
  253.     unsigned short    pixel;
  254.     unsigned short    red;
  255.     unsigned short    green;
  256.     unsigned short    blue;
  257. } SvcColorDef, *SvcColorDefPtr;
  258.  
  259. #endif /* ASSEMBLER */
  260. #endif /* SVC_H */
  261.