home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  7.8 KB  |  270 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Devices.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __DEVICES__
  13. #define __DEVICES__
  14.  
  15. #ifndef __OSUTILS__
  16. #include <OSUtils.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. #endif
  22.  
  23. #ifndef __FILES__
  24. #include <Files.h>
  25. /*    #include <SegLoad.h>                                        */
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29. #include <Quickdraw.h>
  30. /*    #include <QuickdrawText.h>                                    */
  31. /*        #include <IntlResources.h>                                */
  32. #endif
  33.  
  34. #ifndef __EVENTS__
  35. #include <Events.h>
  36. #endif
  37.  
  38. #ifndef __DIALOGS__
  39. #include <Dialogs.h>
  40. /*    #include <Windows.h>                                        */
  41. /*        #include <Controls.h>                                    */
  42. /*            #include <Menus.h>                                    */
  43. /*    #include <TextEdit.h>                                        */
  44. #endif
  45.  
  46. enum  {
  47.     newSelMsg                    = 12,
  48.     fillListMsg                    = 13,
  49.     getSelMsg                    = 14,
  50.     selectMsg                    = 15,
  51.     deselectMsg                    = 16,
  52.     terminateMsg                = 17,
  53.     buttonMsg                    = 19,
  54.     chooserID                    = 1,
  55.     initDev                        = 0,                            /*Time for cdev to initialize itself*/
  56.     hitDev                        = 1,                            /*Hit on one of my items*/
  57.     closeDev                    = 2,                            /*Close yourself*/
  58.     nulDev                        = 3,                            /*Null event*/
  59.     updateDev                    = 4,                            /*Update event*/
  60.     activDev                    = 5,                            /*Activate event*/
  61.     deactivDev                    = 6,                            /*Deactivate event*/
  62.     keyEvtDev                    = 7,                            /*Key down/auto key*/
  63.     macDev                        = 8,                            /*Decide whether or not to show up*/
  64.     undoDev                        = 9,
  65.     cutDev                        = 10,
  66.     copyDev                        = 11
  67. };
  68.  
  69. enum  {
  70.     pasteDev                    = 12,
  71.     clearDev                    = 13,
  72.     cursorDev                    = 14,
  73.     cdevGenErr                    = -1,                            /*General error; gray cdev w/o alert*/
  74.     cdevMemErr                    = 0,                            /*Memory shortfall; alert user please*/
  75.     cdevResErr                    = 1,                            /*Couldn't get a needed resource; alert*/
  76.     cdevUnset                    = 3,                            /* cdevValue is initialized to this*/
  77. /* Monitors control panel messages */
  78.     initMsg                        = 1,                            /*initialization*/
  79.     okMsg                        = 2,                            /*user clicked OK button*/
  80.     cancelMsg                    = 3,                            /*user clicked Cancel button*/
  81.     hitMsg                        = 4,                            /*user clicked control in Options dialog*/
  82.     nulMsg                        = 5,                            /*periodic event*/
  83.     updateMsg                    = 6,                            /*update event*/
  84.     activateMsg                    = 7,                            /*not used*/
  85.     deactivateMsg                = 8,                            /*not used*/
  86.     keyEvtMsg                    = 9,                            /*keyboard event*/
  87.     superMsg                    = 10,                            /*show superuser controls*/
  88.     normalMsg                    = 11,                            /*show only normal controls*/
  89.     startupMsg                    = 12                            /*code has been loaded*/
  90. };
  91.  
  92. #if defined(powerc) || defined (__powerc)
  93. #pragma options align=mac68k
  94. #endif
  95. struct DCtlEntry {
  96.     Ptr                            dCtlDriver;
  97.     short                        dCtlFlags;
  98.     QHdr                        dCtlQHdr;
  99.     long                        dCtlPosition;
  100.     Handle                        dCtlStorage;
  101.     short                        dCtlRefNum;
  102.     long                        dCtlCurTicks;
  103.     WindowPtr                    dCtlWindow;
  104.     short                        dCtlDelay;
  105.     short                        dCtlEMask;
  106.     short                        dCtlMenu;
  107. };
  108. #if defined(powerc) || defined(__powerc)
  109. #pragma options align=reset
  110. #endif
  111.  
  112. typedef struct DCtlEntry DCtlEntry;
  113.  
  114. typedef DCtlEntry *DCtlPtr, **DCtlHandle;
  115.  
  116. #if defined(powerc) || defined (__powerc)
  117. #pragma options align=mac68k
  118. #endif
  119. struct AuxDCE {
  120.     Ptr                            dCtlDriver;
  121.     short                        dCtlFlags;
  122.     QHdr                        dCtlQHdr;
  123.     long                        dCtlPosition;
  124.     Handle                        dCtlStorage;
  125.     short                        dCtlRefNum;
  126.     long                        dCtlCurTicks;
  127.     GrafPtr                        dCtlWindow;
  128.     short                        dCtlDelay;
  129.     short                        dCtlEMask;
  130.     short                        dCtlMenu;
  131.     char                        dCtlSlot;
  132.     char                        dCtlSlotId;
  133.     long                        dCtlDevBase;
  134.     Ptr                            dCtlOwner;
  135.     char                        dCtlExtDev;
  136.     char                        fillByte;
  137. };
  138. #if defined(powerc) || defined(__powerc)
  139. #pragma options align=reset
  140. #endif
  141.  
  142. typedef struct AuxDCE AuxDCE;
  143.  
  144. typedef AuxDCE *AuxDCEPtr, **AuxDCEHandle;
  145.  
  146. typedef pascal long (*ControlPanelDefProcPtr)(short message, short item, short numItems, short cPanelID, EventRecord *theEvent, long cdevValue, DialogPtr cpDialog);
  147.  
  148. enum {
  149.     uppControlPanelDefProcInfo = kPascalStackBased
  150.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  151.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  152.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  153.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  154.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  155.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(EventRecord*)))
  156.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  157.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(DialogPtr)))
  158. };
  159.  
  160. #if USESROUTINEDESCRIPTORS
  161. typedef UniversalProcPtr ControlPanelDefUPP;
  162.  
  163. #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog)        \
  164.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlPanelDefProcInfo, (message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
  165. #define NewControlPanelDefProc(userRoutine)        \
  166.         (ControlPanelDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlPanelDefProcInfo, GetCurrentISA())
  167. #else
  168. typedef ControlPanelDefProcPtr ControlPanelDefUPP;
  169.  
  170. #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog)        \
  171.         (*(userRoutine))((message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
  172. #define NewControlPanelDefProc(userRoutine)        \
  173.         (ControlPanelDefUPP)(userRoutine)
  174. #endif
  175.  
  176. #ifdef __cplusplus
  177. extern "C" {
  178. #endif
  179.  
  180. extern pascal DCtlHandle GetDCtlEntry(short refNum);
  181.  
  182. /*
  183.     SetChooserAlert used to simply set a bit in a low-mem global
  184.     to tell the Chooser not to display its warning message when
  185.     the printer is changed. However, under MultiFinder and System 7,
  186.     this low-mem is swapped out when a layer change occurs, and the
  187.     Chooser never sees the change. It is obsolete, and completely
  188.     unsupported on the PowerPC. 68K apps can still call it if they
  189.     wish.
  190. */
  191.  
  192. #if defined(OBSOLETE) && !defined(powerc) && !defined(__powerc)
  193. extern pascal Boolean SetChooserAlert(Boolean f);
  194. #endif
  195.  
  196. extern pascal OSErr DrvrInstall(Handle drvrHandle, short refNum);
  197. extern pascal OSErr DrvrRemove(short refNum);
  198. extern pascal OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum);
  199. extern OSErr opendriver(char *driverName, short *refNum);
  200. extern pascal OSErr CloseDriver(short refNum);
  201. extern pascal OSErr Control(short refNum, short csCode, const void *csParamPtr);
  202. extern pascal OSErr Status(short refNum, short csCode, void *csParamPtr);
  203. extern pascal OSErr KillIO(short refNum);
  204.  
  205. #if USES68KINLINES
  206. #pragma parameter __D0 PBControlSync(__A0)
  207. #endif
  208. extern pascal OSErr PBControlSync(ParmBlkPtr paramBlock)
  209.  ONEWORDINLINE(0xA004);
  210.  
  211. #if USES68KINLINES
  212. #pragma parameter __D0 PBControlAsync(__A0)
  213. #endif
  214. extern pascal OSErr PBControlAsync(ParmBlkPtr paramBlock)
  215.  ONEWORDINLINE(0xA404);
  216.  
  217. #if USES68KINLINES
  218. #pragma parameter __D0 PBControlImmed(__A0)
  219. #endif
  220. extern pascal OSErr PBControlImmed(ParmBlkPtr paramBlock)
  221.  ONEWORDINLINE(0xA204);
  222.  
  223. #if USES68KINLINES
  224. #pragma parameter __D0 PBStatusSync(__A0)
  225. #endif
  226. extern pascal OSErr PBStatusSync(ParmBlkPtr paramBlock)
  227.  ONEWORDINLINE(0xA005);
  228.  
  229. #if USES68KINLINES
  230. #pragma parameter __D0 PBStatusAsync(__A0)
  231. #endif
  232. extern pascal OSErr PBStatusAsync(ParmBlkPtr paramBlock)
  233.  ONEWORDINLINE(0xA405);
  234.  
  235. #if USES68KINLINES
  236. #pragma parameter __D0 PBStatusImmed(__A0)
  237. #endif
  238. extern pascal OSErr PBStatusImmed(ParmBlkPtr paramBlock)
  239.  ONEWORDINLINE(0xA205);
  240.  
  241. #if USES68KINLINES
  242. #pragma parameter __D0 PBKillIOSync(__A0)
  243. #endif
  244. extern pascal OSErr PBKillIOSync(ParmBlkPtr paramBlock)
  245.  ONEWORDINLINE(0xA006);
  246.  
  247. #if USES68KINLINES
  248. #pragma parameter __D0 PBKillIOAsync(__A0)
  249. #endif
  250. extern pascal OSErr PBKillIOAsync(ParmBlkPtr paramBlock)
  251.  ONEWORDINLINE(0xA406);
  252.  
  253. #if USES68KINLINES
  254. #pragma parameter __D0 PBKillIOImmed(__A0)
  255. #endif
  256. extern pascal OSErr PBKillIOImmed(ParmBlkPtr paramBlock)
  257.  ONEWORDINLINE(0xA206);
  258. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  259.  
  260. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  261.  
  262. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  263.  
  264. #ifdef __cplusplus
  265. }
  266. #endif
  267.  
  268. #endif
  269.  
  270.