6 #define kExtLDEFID 128 // resource id of our LDEF resource
8 typedef void (*ExtLDEFDrawProcType
)(Rect
*r
, Cell cell
, ListHandle lh
, long refcon
);
11 uppExtLDEFDrawProcInfo
= kCStackBased
12 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Rect
*)))
13 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Cell
)))
14 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ListHandle
)))
15 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
18 #if USESROUTINEDESCRIPTORS
19 typedef UniversalProcPtr ExtLDEFDrawProcUPP
;
21 #define CallExtLDEFDrawProc(userRoutine, r, cell, lh , refcon ) \
22 CallUniversalProc((UniversalProcPtr)(userRoutine), uppExtLDEFDrawProcInfo, r, cell, lh , refcon )
23 #define NewExtLDEFDrawProc(userRoutine) \
24 (ExtLDEFDrawProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppExtLDEFDrawProcInfo, GetCurrentISA())
27 typedef ExtLDEFDrawProcType ExtLDEFDrawProcUPP
;
29 #define CallExtLDEFDrawProc(userRoutine, r, cell, lh , refcon) \
30 (*(userRoutine))(r, cell, lh, refcon)
31 #define NewExtLDEFDrawProc(userRoutine) \
32 (ExtLDEFDrawProcUPP)(userRoutine)
38 ExtLDEFDrawProcUPP drawProc
;
41 static void NewExtLDEFInfo( ListHandle lh
, ExtLDEFDrawProcType drawproc
, long refcon
) ;
42 static void NewExtLDEFInfo( ListHandle lh
, ExtLDEFDrawProcType drawproc
, long refcon
)
44 ExtLDEFInfo
* info
= (ExtLDEFInfo
* ) malloc( sizeof( ExtLDEFInfo
) ) ;
45 info
->drawProc
= NewExtLDEFDrawProc( drawproc
) ;
46 info
->refCon
= refcon
;
47 (**lh
).refCon
= (long) info
;
50 static void DisposeExtLDEFInfo( ListHandle lh
) ;
51 static void DisposeExtLDEFInfo( ListHandle lh
)
53 ExtLDEFInfo
* info
= (ExtLDEFInfo
* ) (**lh
).refCon
;
56 DisposeRoutineDescriptor( (RoutineDescriptor
*) info
->drawProc
) ;
57 free( (void*) (**lh
).refCon
) ;