home *** CD-ROM | disk | FTP | other *** search
- /*
- File: InputSprocketDriver.h
-
- Contains: Driver interfaces for InputSprocket.
- Requires the software link with InputSprocketLib
-
- Version: Technology: InputSprocket 1.3
- Release: InputSprocket 1.3
-
- Copyright: © 1986-1998, 1995-1997 by Apple Computer, Inc., all rights reserved
-
- Bugs?: Please include the the file and version information (from above) with
- the problem description. Developers belonging to one of the Apple
- developer programs can submit bug reports to:
-
- devsupport@apple.com
-
- */
-
- #ifndef __INPUTSPROCKETDRIVER__
- #define __INPUTSPROCKETDRIVER__
-
-
- #ifndef __MACTYPES__
- #include <MacTypes.h>
- #endif
-
- #ifndef __ICONS__
- #include <Icons.h>
- #endif
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef __INPUTSPROCKET__
- #include <InputSprocket.h>
- #endif
-
- #if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
- #pragma import on
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=power
- #endif
-
- /*
-
- Resource File Concerns
-
- 1. All resource ids of a driver should be in the range of 256 to 2048
- and the res file should only be open while the drivers panel is visable.
-
- */
-
- enum
- {
- kOSType_ISpDriverFileType = 'shlb',
- kOSType_ISpDriverCreator = 'insp'
- };
-
- /*
- *
- * this function will plot an icon suite of the application (usually for a need)
- *
- */
-
- OSErr ISpPlotAppIconSuite(const Rect *theRect,
- IconAlignmentType align,
- IconTransformType transform,
- short iconSuiteResourceId);
-
- // label2,5,6,7, disabled and offline are reserved
-
- enum
- {
- kISpIconTransform_Selected = kTransformSelected,
-
- // choose one of these (optionally) (these all erase what is behind them to the dialog color)
- kISpIconTransform_PlotIcon = kTransformLabel1,
- kISpIconTransform_PlotPopupButton = kTransformLabel3,
- kISpIconTransform_PlotButton = kTransformLabel4,
-
- // use this is you want to plot the icon while the devices button is pressed
- // or the devices axis is activated and so on
- kISpIconTransform_DeviceActive = kTransformOpen
- };
-
- typedef UInt32 ISpMetaHandlerSelector;
- enum
- {
- kISpSelector_Init =1,
- kISpSelector_Stop,
- kISpSelector_GetSize,
- kISpSelector_HandleEvent,
- kISpSelector_Show,
- kISpSelector_Hide,
- kISpSelector_BeginConfiguration,
- kISpSelector_EndConfiguration,
- kISpSelector_GetIcon,
- kISpSelector_GetState,
- kISpSelector_SetState,
- kISpSelector_Dirty,
- kISpSelector_SetActive,
- kISpSelector_DialogItemHit,
- kISpSelector_Tickle, // 1.03 and later
- kISpSelector_InterruptTickle,
- kISpSelector_Draw,
- kISpSelector_Click,
- kISpSelector_ADBReInit // 1.2 and later
- };
-
-
- /*
- *
- * typedefs for the function pointers the metahandler may return
- *
- */
-
- /* a generic driver function pointer */
- typedef OSStatus (* ISpDriverFunctionPtr_Generic)(UInt32 refCon, ...);
-
- /* the meta handler pointer */
- typedef ISpDriverFunctionPtr_Generic (* ISpDriverFunctionPtr_MetaHandler)(UInt32 refCon, ISpMetaHandlerSelector);
-
- /* the pointers you get through the meta handler */
- typedef OSStatus (* ISpDriverFunctionPtr_Init)(UInt32 refCon, UInt32 count, ISpNeed needs[], ISpElementReference virtualElements[],
- Boolean used[], OSType appCreatorCode, OSType subCreatorCode,
- UInt32 reserved, void* reserved2);
- typedef OSStatus (* ISpDriverFunctionPtr_Stop)(UInt32 refCon);
- typedef OSStatus (* ISpDriverFunctionPtr_GetSize)(UInt32 refCon, Point *minimum, Point *best);
- typedef OSStatus (* ISpDriverFunctionPtr_HandleEvent)(UInt32 refCon, EventRecord *theEvent, Boolean *handled);
- typedef OSStatus (* ISpDriverFunctionPtr_Show)(UInt32 refCon, DialogPtr theDialog, short dialogItemNumber, Rect *r);
- typedef OSStatus (* ISpDriverFunctionPtr_Hide)(UInt32 refCon);
- typedef OSStatus (* ISpDriverFunctionPtr_BeginConfiguration)(UInt32 refCon, UInt32 count, ISpNeed needs[]);
- typedef OSStatus (* ISpDriverFunctionPtr_EndConfiguration)(UInt32 refCon, Boolean accept);
- typedef OSStatus (* ISpDriverFunctionPtr_GetIcon)(UInt32 refCon, short *iconSuiteResourceId);
- typedef OSStatus (* ISpDriverFunctionPtr_GetState)(UInt32 refCon, UInt32 buflen, void *buffer, UInt32 *length);
- typedef OSStatus (* ISpDriverFunctionPtr_SetState)(UInt32 refCon, UInt32 length, void *buffer);
- typedef OSStatus (* ISpDriverFunctionPtr_Dirty)(UInt32 refCon, Boolean *dirty);
- typedef OSStatus (* ISpDriverFunctionPtr_SetActive)(UInt32 refCon, Boolean active);
- typedef OSStatus (* ISpDriverFunctionPtr_DialogItemHit)(UInt32 refCon, short itemHit);
-
- // 1.03 and later
- typedef OSStatus (* ISpDriverFunctionPtr_Tickle)(UInt32 refCon);
- typedef OSStatus (* ISpDriverFunctionPtr_InterruptTickle)(UInt32 refCon);
- typedef OSStatus (* ISpDriverFunctionPtr_Draw)(UInt32 refCon);
- typedef OSStatus (* ISpDriverFunctionPtr_Click)(UInt32 refCon, const EventRecord *event);
-
- // 1.2 and later
- typedef OSStatus (* ISpDriverFunctionPtr_ADBReInit)(UInt32 refCon, Boolean inPostProcess);
-
- /* ********************* driver level functions ********************* */
-
-
- /*
- *
- * ISpDevice_New
- *
- * This creates a new device from the device definition structure and returns
- * the result into the device reference.
- *
- * Returns Codes
- * paramErr
- * out of memory
- *
- * Specical Considerations
- * may not be done at interrupt time
- */
-
- OSStatus ISpDevice_New( const ISpDeviceDefinition *inStruct,
- ISpDriverFunctionPtr_MetaHandler metaHandler,
- UInt32 refCon,
- ISpDeviceReference *outReference);
-
- /*
- * ISpDevice_Dispose
- *
- * This disposes an existing device.
- *
- * Returns Codes
- * paramErr
- *
- * Special Considerations
- * May not be done at interrupt time
- *
- */
-
- OSStatus ISpDevice_Dispose(ISpDeviceReference inReference);
-
-
- /*
- *
- * ISpElementDefinitionStruct
- *
- * This is the structure that defines everything static about this
- * element. For each element on your device you will need to
- * fill in one of these structures when your driver loads.
- *
- */
-
- typedef struct ISpElementDefinitionStruct
- {
- ISpDeviceReference device; /* device this element belongs to */
- UInt32 group; /* group this element belongs to or 0 */
-
- Str63 theString; /* a string that is a human readable identifier for this element, internationalization ? */
-
- ISpElementKind kind;
- ISpElementLabel label;
-
- void *configInfo; /* a pointer to the buffer containing the configuration information for this element */
- UInt32 configInfoLength; /* length of that configuration info */
-
- UInt32 dataSize; /* the size of the data, so we can generate an appropriate buffer */
-
- UInt32 reserved1;
- UInt32 reserved2;
- UInt32 reserved3;
- } ISpElementDefinitionStruct;
-
- /*
- *
- * ISpElement_New
- *
- * ISpElement_New takes an element definition struct and gives you back a element reference.
- * When you produce data you use that element reference to give the data to the system.
- *
- * Return Codes
- * paramErr
- * memory error
- *
- * Special Considerations
- * The ISpElement_New function may move or purge memory. Your application should not call this function
- * at interrupt time.
- *
- */
-
- OSStatus ISpElement_New(const ISpElementDefinitionStruct *inStruct, ISpElementReference *outElement);
-
- /*
- *
- * ISpElement_Dispose
- *
- * ISpElement_Dispose takes an element reference and deletes it.
- * You should call this function when your driver unloads.
- *
- * Return Codes
- * paramErr
- * memory error
- *
- * Special Considerations
- * The ISpElement_Dispose function may move or purge memory. Your application should not call this function
- * at interrupt time.
- *
- */
-
- OSStatus ISpElement_Dispose(ISpElementReference inElement);
-
- /*
- *
- * ISpElement_PushSimpleData
- *
- * ISpElement_PushSimpleData is the appropriate way to give the system data if your data fits exactly into
- * a 32 bit signed number. You pass the element reference that goes with the data, the data and the
- * AbsoluteTime that data was produced. If UpTime is not available you should fill time.lo with the
- * TickCount time and time.hi with 0.
- *
- * Return Codes
- * paramErr
- *
- */
-
- OSStatus ISpElement_PushSimpleData(ISpElementReference inElement, UInt32 data, const AbsoluteTime *time);
-
- /*
- *
- * ISpElement_PushComplexData
- *
- * ISpElement_PushComplexData is exactly like ISpElement_PushSimpleData except that it is appropriate for times
- * when your data does not fit into a signed 32 bit integer.
- *
- * Instead it takes the length of your data (which must match the datasize field of your ISpElementDefinitionStruct)
- * and a ptr to the devices state.
- *
- * Return Codes
- * paramErr
- *
- */
-
- OSStatus ISpElement_PushComplexData(ISpElementReference inElement, UInt32 buflen, void *state, const AbsoluteTime *time);
-
-
- /*
- *
- *
- * use this to get the time
- *
- *
- */
-
- AbsoluteTime ISpUptime(void);
-
- #ifdef __cplusplus
- }
- #endif
-
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #endif /* __INPUTSPROCKETDRIVER__ */
-