home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / Video.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  15.4 KB  |  382 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Video.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Video;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __VIDEO__}
  27. {$SETC __VIDEO__ := 1}
  28.  
  29. {$I+}
  30. {$SETC VideoIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __QUICKDRAW__}
  35. {$I Quickdraw.p}
  36. {$ENDC}
  37. {    Types.p                                                        }
  38. {        ConditionalMacros.p                                        }
  39. {    MixedMode.p                                                    }
  40. {    QuickdrawText.p                                                }
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. CONST
  47.     mBaseOffset                    = 1;                            {Id of mBaseOffset.}
  48.     mRowBytes                    = 2;                            {Video sResource parameter Id's }
  49.     mBounds                        = 3;                            {Video sResource parameter Id's }
  50.     mVersion                    = 4;                            {Video sResource parameter Id's }
  51.     mHRes                        = 5;                            {Video sResource parameter Id's }
  52.     mVRes                        = 6;                            {Video sResource parameter Id's }
  53.     mPixelType                    = 7;                            {Video sResource parameter Id's }
  54.     mPixelSize                    = 8;                            {Video sResource parameter Id's }
  55.     mCmpCount                    = 9;                            {Video sResource parameter Id's }
  56.     mCmpSize                    = 10;                            {Video sResource parameter Id's }
  57.     mPlaneBytes                    = 11;                            {Video sResource parameter Id's }
  58.     mVertRefRate                = 14;                            {Video sResource parameter Id's }
  59.     mVidParams                    = 1;                            {Video parameter block id.}
  60.     mTable                        = 2;                            {Offset to the table.}
  61.     mPageCnt                    = 3;                            {Number of pages}
  62.     mDevType                    = 4;                            {Device Type}
  63.     oneBitMode                    = 128;                            {Id of OneBitMode Parameter list.}
  64.     twoBitMode                    = 129;                            {Id of TwoBitMode Parameter list.}
  65.     fourBitMode                    = 130;                            {Id of FourBitMode Parameter list.}
  66.     eightBitMode                = 131;                            {Id of EightBitMode Parameter list.}
  67.  
  68.     sixteenBitMode                = 132;                            {Id of SixteenBitMode Parameter list.}
  69.     thirtyTwoBitMode            = 133;                            {Id of ThirtyTwoBitMode Parameter list.}
  70.     firstVidMode                = 128;                            {The new, better way to do the above. }
  71.     secondVidMode                = 129;                            { QuickDraw only supports six video }
  72.     thirdVidMode                = 130;                            { at this time.      }
  73.     fourthVidMode                = 131;
  74.     fifthVidMode                = 132;
  75.     sixthVidMode                = 133;
  76.     spGammaDir                    = 64;
  77.     spVidNamesDir                = 65;
  78.  
  79. { csTimingFormat values in VDTimingInfo }
  80. { look in the declaration rom for timing info }
  81.     kDeclROMtables                = 'decl';
  82.  
  83. { Timing mode constants for Display Manager MultiMode support
  84.     Corresponding    .h equates are in Video.h
  85.                     .a equates are in Video.a
  86.                     .r equates are in DepVideoEqu.r
  87. }
  88.     timingInvalid                = 0;                            { Unknown timing… force user to confirm.}
  89.     timingApple12                = 130;                            {  512x384 (60 Hz) Rubik timing.}
  90.     timingApple12x                = 135;                            {  560x384 (60 Hz) Rubik-560 timing.}
  91.     timingApple13                = 140;                            {  640x480 (67 Hz) HR timing.}
  92.     timingApple13x                = 145;                            {  640x400 (67 Hz) HR-400 timing.}
  93.     timingAppleVGA                = 150;                            {  640x480 (60 Hz) VGA timing.}
  94.     timingApple15                = 160;                            {  640x870 (75 Hz) FPD timing.}
  95.     timingApple15x                = 165;                            {  640x818 (75 Hz) FPD-818 timing.}
  96.     timingApple16                = 170;                            {  832x624 (75 Hz) GoldFish timing.}
  97.     timingAppleSVGA                = 180;                            {  800x600 (56 Hz) SVGA timing.}
  98.     timingApple1Ka                = 190;                            { 1024x768 (60 Hz) VESA 1K-60Hz timing.}
  99.     timingApple1Kb                = 200;                            { 1024x768 (70 Hz) VESA 1K-70Hz timing.}
  100.     timingApple19                = 210;                            { 1024x768 (75 Hz) Apple 19" RGB.}
  101.     timingApple21                = 220;                            { 1152x870 (75 Hz) Apple 21" RGB.}
  102.     timingAppleNTSC_ST            = 230;                            {  512x384 (60 Hz, interlaced, non-convolved).}
  103.     timingAppleNTSC_FF            = 232;                            {  640x480 (60 Hz, interlaced, non-convolved).}
  104.     timingAppleNTSC_STconv        = 234;                            {  512x384 (60 Hz, interlaced, convolved).}
  105.     timingAppleNTSC_FFconv        = 236;                            {  640x480 (60 Hz, interlaced, convolved).}
  106.     timingApplePAL_ST            = 238;                            {  640x480 (50 Hz, interlaced, non-convolved).}
  107.     timingApplePAL_FF            = 240;                            {  768x576 (50 Hz, interlaced, non-convolved).}
  108.     timingApplePAL_STconv        = 242;                            {  640x480 (50 Hz, interlaced, non-convolved).}
  109.     timingApplePAL_FFconv        = 244;                            {  768x576 (50 Hz, interlaced, non-convolved).}
  110.  
  111. { csConnectFlags values in VDDisplayConnectInfo }
  112.     kAllModesValid                = 0;                            { All modes not trimmed by primary init are good close enough to try }
  113.     kAllModesSafe                = 1;                            { All modes not trimmed by primary init are know to be safe }
  114.     kReportsTagging                = 2;                            { Can detect tagged displays (to identify smart monitors) }
  115.     kHasDirectConnection        = 3;                            { True implies that driver can talk directly to device (e.g. serial data link via sense lines) }
  116.     kIsMonoDev                    = 4;                            { Says whether there’s an RGB (0) or Monochrome (1) connection. }
  117.     kUncertainConnection        = 5;                            { There may not be a display (no sense lines?). }
  118.     kReservedConnectionBit        = 6;                            { Reserved for now }
  119.     kReportsDDCConnection        = 7;                            { Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). }
  120.     kHasDDCConnection            = 8;                            { Card has ddc connect now. }
  121.  
  122. { csDisplayType values in VDDisplayConnectInfo }
  123.     kUnknownConnect                = 1;                            { Not sure how we’ll use this, but seems like a good idea. }
  124.     kPanelConnect                = 2;                            { For use with fixed-in-place LCD panels. }
  125.     kPanelTFTConnect            = 2;                            { Alias for kPanelConnect }
  126.     kFixedModeCRTConnect        = 3;                            {  For use with fixed-mode (i.e., very limited range) displays. }
  127.     kMultiModeCRT1Connect        = 4;                            { 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe }
  128.     kMultiModeCRT2Connect        = 5;                            { 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe }
  129.     kMultiModeCRT3Connect        = 6;                            { 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain }
  130.     kMultiModeCRT4Connect        = 7;                            { Expansion to large multi mode (not yet used) }
  131.     kModelessConnect            = 8;                            { Expansion to modeless model (not yet used) }
  132.     kFullPageConnect            = 9;                            { 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) }
  133.     kVGAConnect                    = 10;                            { 640x480 VGA default -- question everything else }
  134.     kNTSCConnect                = 11;                            { NTSC ST (default), FF, STconv, FFconv }
  135.     kPALConnect                    = 12;                            { PAL ST (default), FF, STconv, FFconv }
  136.     kHRConnect                    = 13;                            { 640x400 (to get 8bpp in 256K case) and 640x480 (these two only) }
  137.     kPanelFSTNConnect            = 14;                            { For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels }
  138.  
  139. { csTimingFlags values in VDTimingInfoRec }
  140.     kModeValid                    = 0;                            { Says that this mode should NOT be trimmed. }
  141.     kModeSafe                    = 1;                            { This mode does not need confirmation }
  142.     kModeDefault                = 2;                            { This is the default mode for this type of connection }
  143.     kModeShowNow                = 3;                            { This mode should always be shown (even though it may require a confirm) }
  144.     kModeNotResize                = 4;                            { This mode should not be used to resize the display (eg. mode selects a different connector on card) }
  145.  
  146. { Control Codes }
  147.     cscReset                    = 0;
  148.     cscKillIO                    = 1;
  149.     cscSetMode                    = 2;
  150.     cscSetEntries                = 3;
  151.     cscSetGamma                    = 4;
  152.     cscGrayPage                    = 5;
  153.     cscGrayScreen                = 5;
  154.     cscSetGray                    = 6;
  155.     cscSetInterrupt                = 7;
  156.     cscDirectSetEntries            = 8;
  157.     cscSetDefaultMode            = 9;
  158.     cscSwitchMode                = 10;
  159.     cscSetSync                    = 11;
  160.     cscSavePreferredConfiguration = 16;
  161.  
  162. { Status Codes }
  163.     cscGetMode                    = 2;
  164.     cscGetEntries                = 3;
  165.     cscGetPageCnt                = 4;
  166.     cscGetPages                    = 4;                            { This is what C&D 2 calls it. }
  167.     cscGetPageBase                = 5;
  168.     cscGetBaseAddr                = 5;                            { This is what C&D 2 calls it. }
  169.     cscGetGray                    = 6;
  170.     cscGetInterrupt                = 7;
  171.     cscGetGamma                    = 8;
  172.     cscGetDefaultMode            = 9;
  173.     cscGetCurMode                = 10;
  174.     cscGetSync                    = 11;
  175.     cscGetConnection            = 12;                            { Return information about the connection to the display }
  176.     cscGetModeTiming            = 13;                            { Return timing info for a mode }
  177.     cscGetModeBaseAddress        = 14;                            { Return base address information about a particular mode }
  178.     cscGetScanProc                = 15;                            { QuickTime scan chasing routine }
  179.     cscGetPreferredConfiguration = 16;
  180.     cscGetNextResolution        = 17;
  181.     cscGetVideoParameters        = 18;
  182.     cscGetGammaList                = 19;
  183.  
  184. { Bit definitions for the Get/Set Sync call}
  185.     kHorizontalSyncDisableBit    = 0;
  186.     kVerticalSyncDisableBit        = 1;
  187.     kCompositeSyncDisableBit    = 2;
  188.     kSyncOnRedEnableBit            = 3;
  189.     kSyncOnGreenEnableBit        = 4;
  190.     kSyncOnBlueEnableBit        = 5;
  191.     kHorizontalSyncMask            = $01;
  192.     kVerticalSyncMask            = $02;
  193.     kCompositeSyncMask            = $04;
  194.     kDPMSSyncMask                = $7;
  195.     kSyncOnRedMask                = $08;
  196.     kSyncOnGreenMask            = $10;
  197.     kSyncOnBlueMask                = $20;
  198.     kSyncOnMask                    = $38;
  199.  
  200.  
  201. TYPE
  202.     VPBlock = RECORD
  203.         vpBaseOffset:            LONGINT;                                {Offset to page zero of video RAM (From minorBaseOS).}
  204.         vpRowBytes:                INTEGER;                                {Width of each row of video memory.}
  205.         vpBounds:                Rect;                                    {BoundsRect for the video display (gives dimensions).}
  206.         vpVersion:                INTEGER;                                {PixelMap version number.}
  207.         vpPackType:                INTEGER;
  208.         vpPackSize:                LONGINT;
  209.         vpHRes:                    LONGINT;                                {Horizontal resolution of the device (pixels per inch).}
  210.         vpVRes:                    LONGINT;                                {Vertical resolution of the device (pixels per inch).}
  211.         vpPixelType:            INTEGER;                                {Defines the pixel type.}
  212.         vpPixelSize:            INTEGER;                                {Number of bits in pixel.}
  213.         vpCmpCount:                INTEGER;                                {Number of components in pixel.}
  214.         vpCmpSize:                INTEGER;                                {Number of bits per component}
  215.         vpPlaneBytes:            LONGINT;                                {Offset from one plane to the next.}
  216.     END;
  217.     VPBlockPtr = ^VPBlock;
  218.  
  219.     VDEntryRecord = RECORD
  220.         csTable:                Ptr;                                    {(long) pointer to color table entry=value, r,g,b:INTEGER}
  221.     END;
  222.     VDEntRecPtr = ^VDEntryRecord;
  223.  
  224. { Parm block for SetGray control call }
  225.     VDGrayRecord = RECORD
  226.         csMode:                    BOOLEAN;                                {Same as GDDevType value (0=mono, 1=color)}
  227.     END;
  228.     VDGrayPtr = ^VDGrayRecord;
  229.  
  230. { Parm block for SetEntries control call }
  231.     VDSetEntryRecord = RECORD
  232.         csTable:                ^ColorSpec;                                {Pointer to an array of color specs}
  233.         csStart:                INTEGER;                                {Which spec in array to start with, or -1}
  234.         csCount:                INTEGER;                                {Number of color spec entries to set}
  235.     END;
  236.     VDSetEntryPtr = ^VDSetEntryRecord;
  237.  
  238. { Parm block for SetGamma control call }
  239.     VDGammaRecord = RECORD
  240.         csGTable:                Ptr;                                    {pointer to gamma table}
  241.     END;
  242.     VDGamRecPtr = ^VDGammaRecord;
  243.  
  244.     VDSwitchInfoRec = RECORD
  245.         csMode:                    INTEGER;                                {(word) mode depth}
  246.         csData:                    LONGINT;                                {(long) functional sResource of mode}
  247.         csPage:                    INTEGER;                                {(word) page to switch in}
  248.         csBaseAddr:                Ptr;                                    {(long) base address of page (return value)}
  249.         csReserved:                LONGINT;                                {(long) Reserved (set to 0) }
  250.     END;
  251.     VDSwitchInfoPtr = ^VDSwitchInfoRec;
  252.  
  253.     VDTimingInfoRec = RECORD
  254.         csTimingMode:            LONGINT;                                { LONGINT - (long) timing mode (a la InitGDevice) }
  255.         csTimingReserved:        LONGINT;                                { LONGINT - (long) reserved }
  256.         csTimingFormat:            LONGINT;                                { LONGINT - (long) what format is the timing info }
  257.         csTimingData:            LONGINT;                                { LONGINT - (long) data supplied by driver }
  258.         csTimingFlags:            LONGINT;                                { LONGINT - (long) mode within device }
  259.     END;
  260.     VDTimingInfoPtr = ^VDTimingInfoRec;
  261.  
  262.     VDDisplayConnectInfoRec = RECORD
  263.         csDisplayType:            INTEGER;                                { INTEGER - (word) Type of display connected }
  264.         csConnectTagged:        INTEGER;                                { INTEGER - (word) Display is currently "it" (tagged to identify component) }
  265.         csConnectFlags:            LONGINT;                                { LONGINT - (long) tell us about the connection }
  266.         csDisplayComponent:        LONGINT;                                { LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) }
  267.         csConnectReserved:        LONGINT;                                { LONGINT - (long) reserved }
  268.     END;
  269.     VDDisplayConnectInfoPtr = ^VDDisplayConnectInfoRec;
  270.  
  271.     VDPageInfo = RECORD
  272.         csMode:                    INTEGER;                                {(word) mode within device}
  273.         csData:                    LONGINT;                                {(long) data supplied by driver}
  274.         csPage:                    INTEGER;                                {(word) page to switch in}
  275.         csBaseAddr:                Ptr;                                    {(long) base address of page}
  276.     END;
  277.     VDPgInfoPtr = ^VDPageInfo;
  278.  
  279.     VDSizeInfo = RECORD
  280.         csHSize:                INTEGER;                                {(word) desired/returned h size}
  281.         csHPos:                    INTEGER;                                {(word) desired/returned h position}
  282.         csVSize:                INTEGER;                                {(word) desired/returned v size}
  283.         csVPos:                    INTEGER;                                {(word) desired/returned v position}
  284.     END;
  285.     VDSzInfoPtr = ^VDSizeInfo;
  286.  
  287.     VDSettings = RECORD
  288.         csParamCnt:                INTEGER;                                {(word) number of params}
  289.         csBrightMax:            INTEGER;                                {(word) max brightness}
  290.         csBrightDef:            INTEGER;                                {(word) default brightness}
  291.         csBrightVal:            INTEGER;                                {(word) current brightness}
  292.         csCntrstMax:            INTEGER;                                {(word) max contrast}
  293.         csCntrstDef:            INTEGER;                                {(word) default contrast}
  294.         csCntrstVal:            INTEGER;                                {(word) current contrast}
  295.         csTintMax:                INTEGER;                                {(word) max tint}
  296.         csTintDef:                INTEGER;                                {(word) default tint}
  297.         csTintVal:                INTEGER;                                {(word) current tint}
  298.         csHueMax:                INTEGER;                                {(word) max hue}
  299.         csHueDef:                INTEGER;                                {(word) default hue}
  300.         csHueVal:                INTEGER;                                {(word) current hue}
  301.         csHorizDef:                INTEGER;                                {(word) default horizontal}
  302.         csHorizVal:                INTEGER;                                {(word) current horizontal}
  303.         csHorizMax:                INTEGER;                                {(word) max horizontal}
  304.         csVertDef:                INTEGER;                                {(word) default vertical}
  305.         csVertVal:                INTEGER;                                {(word) current vertical}
  306.         csVertMax:                INTEGER;                                {(word) max vertical}
  307.     END;
  308.     VDSettingsPtr = ^VDSettings;
  309.  
  310.     DisplayModeID = LONGINT;
  311.  
  312.     VideoDeviceType = LONGINT;
  313.  
  314.     DepthMode = INTEGER;
  315.  
  316.     GammaTableID = LONGINT;
  317.  
  318.  
  319. CONST
  320.     kFirstDepthMode                = 128;
  321.     kSecondDepthMode            = 129;
  322.     kThirdDepthMode                = 130;
  323.     kFourthDepthMode            = 131;
  324.     kFifthDepthMode                = 132;
  325.     kSixthDepthMode                = 133;
  326.  
  327.  
  328. TYPE
  329.     VDResolutionInfoRec = RECORD
  330.         csPreviousDisplayModeID: DisplayModeID;                            { ID of the previous resolution in a chain }
  331.         csDisplayModeID:        DisplayModeID;                            { ID of the next resolution }
  332.         csHorizontalPixels:        LONGINT;                                { # of pixels in a horizontal line }
  333.         csVerticalLines:        LONGINT;                                { # of lines in a screen }
  334.         csRefreshRate:            Fixed;                                    { Vertical Refresh Rate in Hz }
  335.         csMaxDepthMode:            DepthMode;                                { 0x80-based number representing max bit depth }
  336.         csReserved:                LONGINT;                                { Reserved }
  337.         csReserved1:            LONGINT;                                { Reserved }
  338.     END;
  339.     VDResolutionInfoPtr = ^VDResolutionInfoRec;
  340.  
  341.     VDVideoParametersInfoRec = RECORD
  342.         csDisplayModeID:        DisplayModeID;                            { the ID of the resolution we want info on }
  343.         csDepthMode:            DepthMode;                                { The bit depth we want the info on (0x80 based) }
  344.         csVPBlockPtr:            VPBlockPtr;                                { Pointer to a video parameter block }
  345.         csPageCount:            LONGINT;                                { Number of pages supported by the resolution }
  346.         csDeviceType:            VideoDeviceType;                        { Device Type:  Direct, Fixed or CLUT; }
  347.         csReserved:                LONGINT;                                { Reserved }
  348.     END;
  349.     VDVideoParametersInfoPtr = ^VDVideoParametersInfoRec;
  350.  
  351.     VDGammaInfoRec = RECORD
  352.         csLastGammaID:            GammaTableID;                            { the ID of the previous gamma table }
  353.         csNextGammaID:            GammaTableID;                            { the ID of the next gamma table }
  354.         csGammaPtr:                Ptr;                                    { Ptr to a gamma table data }
  355.         csReserved:                LONGINT;                                { Reserved }
  356.     END;
  357.     VDGammaInfoPtr = ^VDGammaInfoRec;
  358.  
  359.     VDDefMode = RECORD
  360.         csID:                    SInt8;
  361.         filler1:                SInt8;
  362.     END;
  363.     VDDefModePtr = ^VDDefMode;
  364.  
  365.     VDSyncInfoRec = RECORD
  366.         csMode:                    SInt8;
  367.         csFlags:                SInt8;
  368.     END;
  369.     VDSyncInfoPtr = ^VDSyncInfoRec;
  370.  
  371.  
  372. {$ALIGN RESET}
  373. {$POP}
  374.  
  375. {$SETC UsingIncludes := VideoIncludes}
  376.  
  377. {$ENDC} {__VIDEO__}
  378.  
  379. {$IFC NOT UsingIncludes}
  380.  END.
  381. {$ENDC}
  382.