Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Source/DAEntry.a
; |
; Copyright 1991-1996 Apple Computer. All rights reserved. |
; |
; You may incorporate this sample code into your applications without |
; restriction, though the sample code has been provided "AS IS" and the |
; responsibility for its operation is 100% yours. However, what you are |
; not permitted to do is to redistribute the source as "DSC Sample Code" |
; after having made changes. If you're going to re-distribute the source, |
; we require that you make it clear in the source that the code was |
; descended from Apple Sample Code, but that you've made changes. |
; |
*************************************************************************** |
**** |
**** DESK ACCESSORY and DEVICE DRIVER Entry Code/Data |
**** |
*************************************************************************** |
STRING PASCAL |
INCLUDE 'ToolEqu.a' |
INCLUDE 'SysEqu.a' |
CASE OBJ |
**************************** DESK ACCESSORY ENTRY ************************** |
IMPORT %DRVRMain |
DAEntry Proc Export ; See Device Manager IM:2 |
; |
; First we need to set the drvrFlags (IM II-188), choose from |
; |
; dReadEnable enable driver for read operations (drivers only) |
; dWritEnable enable driver for writing (drivers only) |
; dCtlEnable enable driver/da for control operations |
; dStatEnable enable driver/da for status operations (drivers only) |
; dNeedGoodBye driver/da needs a "goodbye kiss" |
; dNeedTime driver/da needs "main thread" time |
; dNeedLock driver will be accessed at interrupt level (drivers only) |
; |
DC.B (1<<dCtlEnable) + (1<<dStatEnable) ; periodic, control flags set |
DC.B 0 ; Lower byte is unused |
; |
; Next is the the drvrDelay (IM II-188), set only if dNeedTime flag set above |
; |
DC.W 0 ; 5 sec periodic update |
; |
; Next is the the drvrEMask (IM I-444), which events DA can respond to... |
; Must be NIL for drivers, for DA's choose from |
; mButDwnEvt mouse button down is event 1 |
; keyDwnEvt key down is event 3 |
; keyUpEvt key up is event 4 |
; autoKeyEvt auto-repeated key is event 5 |
; updatEvt update event |
; activateEvt activate/deactive event |
; |
DC.W 0 ; Handle activate, update events |
; |
; Next is the the drvrMenu (IM I-444), Menu ID of DA's menu, or NIL |
; |
DC.W 0 ; No associated menu |
; |
; Next are the offsets to the main routines of the driver/DA |
; |
DC.W %DRVRMain - DAEntry ; Open routine |
DC.W %DRVRMain - DAEntry +4 ; Prime - unused for DA's |
DC.W %DRVRMain - DAEntry +8 ; Control |
DC.W %DRVRMain - DAEntry +12 ; Status - unused for DA's |
DC.W %DRVRMain - DAEntry +16 ; Close |
; |
; Next are the offsets to the main routines of the driver/DA |
; |
DAName |
DC.B '.Print' ; DA/DRVR Name |
; ORG DAName+32 ; Pad string out to 32 bytes |
END |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-03-26