home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Apple Guide / Engineering / Context Check Modules / Standard CC Modules / Context.h < prev    next >
Encoding:
Text File  |  1994-04-25  |  6.8 KB  |  173 lines  |  [TEXT/MPS ]

  1. //    File:        Context.h
  2. //    Copyright:    © 1993 Apple Computer, Inc. All rights reserved.
  3. //    Author:        Victor J. Hnyp
  4. //                Dave Lyons
  5. //    Date:        3-Mar-94
  6.  
  7. // Revisions
  8. //
  9. //    03/03/94    DAL    3.02    Moved from Dialog Context to Window Context: isFindDialog,
  10. //                            isFindMoreDialog, isAnyDialogActive.  The selector numbers
  11. //                            had to change.
  12. //
  13. //  01/13/94    DAL    3.01    Added allBitsSet and someBitsSet compare selectors for Gestalt
  14. //                            check.  (They aren't really needed in this file, but it was the
  15. //                            closest thing I found to a master list.)
  16. //
  17. //  -----------------------------------------------------------------------------------------------
  18. //
  19. //    11/5/93        JJ    2.12    Added isCollapsed to Window module
  20. //
  21. //    9/3/93        JJ    2.11    Added isAnyZones to Chooser module
  22. //
  23. //    04/08/93    VJH    2.10    Moved isFindDialog, isFindMoreDialog back to Dialog module.
  24. //
  25. //    03/13/93    VJH    2.09    Moved isFindDialog, isFindMoreDialog to Window module.
  26. //
  27. //    03/11/93    VJH    2.08    Added selectors: seeFolders, seeFiles, makeChanges.
  28. //
  29. //    02/24/93    VJH    2.07    Added isShareWindowOpen, isShareWindowActive. Removed isSharedOwned.
  30. //
  31. //    01/18/93    VJH    2.06    Minor fixups
  32. //
  33. //    01/18/93    VJH    2.05    Added isFileExists
  34. //
  35. //    01/04/93    VJH    2.04    Changed Copyright notice, minor cleanup
  36. //
  37. //    12/14/92    VJH    2.03    Added Chooser and System constants, eliminated some duplicates
  38. //
  39. //    11/29/92    VJH    2.02    Added File constants
  40. //
  41. //    11/16/92    GB    2.01    Added "kCntx" constants
  42. //
  43.  
  44.         // All structures consists of 5 longs and 2 StringSpecs.
  45.         // Total length is 20 bytes + strings.
  46.         // Format:
  47.         //        longint;            // REQUIRED (but not passed to module)
  48.         //                            // 4-character module ID - One of:
  49.         //                                'CHSR' - Chooser Module
  50.         //                                'DLOG' - Dialog Module
  51.         //                                'FILE' - File Module
  52.         //                                'FNDR' - Finder Module
  53.         //                                'PCSS' - Process Module
  54.         //                                'SYST' - System Module
  55.         //                                'WIND' - Window Module
  56.         //        longint;            // REQUIRED (by each module)
  57.         //                                Function Selector within the module
  58.         //        longint;            // anything
  59.         //        longint;            // StringCompareMethod of StringSpec
  60.         //        pstring;            // String of StringSpec (variable len.)
  61.         //        align word;
  62.         //        longint;            // StringCompareMethod of StringSpec
  63.         //        pstring;            // String of StringSpec (variable len.)
  64.         // The pstring can be any variable-length structure.
  65.         // We go to this trouble for two reasons:
  66.         //        1. To be able to write a ResEdit TMPL for localization.
  67.         //        2. To encapsulate a "universal" context test spec.
  68.  
  69.  
  70. #define kCntxSystem            'SYST'
  71. #define kCntxWindow            'WIND'
  72. #define kCntxProcess        'PCSS'
  73. #define kCntxDialog            'DLOG'
  74. #define kCntxChooser        'CHSR'
  75. #define kCntxFile            'FILE'
  76. #define kCntxFinder            'FNDR'
  77.  
  78.  
  79. //    This defines the General Compare Selectors:
  80.  
  81. #define    off                        0
  82. #define    on                        1
  83. #define    equals                    2
  84. #define    notEqualTo                3
  85. #define    greaterThan                4
  86. #define    lessThan                5
  87. #define    greaterThanOrEqualTo    6
  88. #define    lessThanOrEqualTo        7
  89. #define    containsAnything        8
  90. #define    empty                    9
  91. #define    matches                    10
  92. #define    contains                11
  93. #define    startsWith                12
  94. #define    endsWith                13
  95. #define    seeFolders                14
  96. #define    seeFiles                15
  97. #define    makeChanges                16
  98.  
  99. #define allBitsSet                17        /* Gestalt: all specified bits are set */
  100. #define someBitsSet                18        /* Gestalt: some specified bits are set */
  101.  
  102. #define    ModemPort                0        /* We are interested in the modem port */
  103. #define PrinterPort                1        /* We are interested in the printer port */
  104. #define EitherPort                2        /* We are interested in either port */
  105.  
  106.  
  107. //    This defines the Dialog, Window, and Process Context function selectors:
  108.  
  109. #define    isFront                    0        // Interested in the front dialog/window/application...
  110. #define    isOpen                    1        // Interested in the open dialog/window/application...
  111. #define    isInvisible                2        // Is the name of the invisible dialog/window...
  112. #define    isCollapsed                5        // Is the window collapsed by WindowShade
  113.  
  114.  
  115. //    This defines the Chooser Selectors:
  116.  
  117. #define    isPrinterDirect            0        // Is a printer connected directly to this Macintosh?
  118. #define    isPrintersOnZone        1        // Is the number of network printers connected to our zone...?
  119. #define isPrinterSerial            2        // Is a serial printer connected to this Macintosh through ModemPort/PrinterPort?
  120. #define    isPrinterSCSI            3        // Is a printer connected to this Macintosh through a SCSI port?
  121. #define    isPrinterType            4        // Is the selected printer named...
  122. #define    isAppleTalk                5        // Is AppleTalk on/off?
  123. #define isNumberOfZones            6        // Does the network have any zones?
  124. #define    isPortSelected            7        // Is ModemPort/PrinterPort selected?
  125. #define    isPortInUse                8        // Is ModemPort/PrinterPort currently in use?
  126. #define    isAnyZones                9        //    2 or 3 boxes in the Chooser?
  127.  
  128. //    This defines additional Dialog Context Selectors:
  129.  
  130. // (none, since isFindDialog, isFindMoreDialog, and isAnyDialogActive moved to Window)
  131.  
  132.  
  133. //    This defines the File Selectors:
  134.  
  135. #define    isFrontStartup            0        // Is the frontmost (active) window the same name as the startup volume name?
  136. #define    isOpenStartup            1        // Is the name of any open and visible window the same name as the startup volume name?
  137. #define    isCDStartup                2        // Is the current directory the startup disks?
  138. #define    isPrintMonitor            3        // Is PrintMonitor installed?
  139. #define    isAppleShare            4        // Is AppleShare support software installed?
  140. #define    isEtherTalk                5        // Is EtherTalk support software installed?
  141. #define    isTokenTalk                6        // Is TokenTalk support software installed?
  142. #define isControlPanel            7        // Is the Control Panel named "..." installed?
  143. #define isFileExists            9        // Is the File named "..." within the system-defined folder ...?
  144.  
  145.  
  146. //    This defines the System Selectors:
  147.  
  148. #define    gestaltCheck            0        // How does Gestalt selector "..." compare to result "..."?
  149. #define    menuItemExists            1        // Does menuItem titled "..." exist within menu titled "..."?
  150. #define    menuItemMarked            2        // Is the menu item titled "..." marked within menu titled "..."?
  151. #define    menuItemEnabled            3        // Is the menu item titled "..." enabled within menu titled "..."?
  152. #define    menuItemDisabled        4        // Is the menu item titled "..." disabled within menu titled "..."?
  153. #define isBackgroundPrinting    5        // Is background printing on/off?
  154. #define isFileSharing            6        // Is file sharing on/off?
  155. #define isVideoHWBitDepth        7        // Is the video hardware bit depth...?
  156. #define isMonitorBitDepth        8        // Is the main video monitor color depth...?
  157. #define isComputerNamed            9        // Does the computer have a name?
  158. #define isGuestAccess            10        // Is guest access for files available?
  159. #define isNumberMonitors        11        // Is the number of monitors...?
  160.  
  161.  
  162. //    This defines additional Window Context Selectors:
  163.  
  164. #define    isShareWindowOpen        3        // Is the "Sharing" window open?
  165. #define    isShareWindowActive        4        // Is the "Sharing" window the active window?
  166.  
  167. // isCollapsed is 5
  168.  
  169. #define    isFindDialog            6        // Is the Find Dialog active?
  170. #define    isFindMoreDialog        7        // Is the Find "More Choices" Dialog active?
  171. #define    isAnyDialogActive        8        // Is any Dialog currently active?
  172.  
  173.