4 #include <Carbon/Carbon.h>
10 #define kExtLDEFID 128 // resource id of our LDEF resource
12 typedef void (*ExtLDEFDrawProcType
)(Rect
*r
, Cell cell
, ListHandle lh
, long refcon
);
15 uppExtLDEFDrawProcInfo
= kCStackBased
16 | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Rect
*)))
17 | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Cell
)))
18 | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ListHandle
)))
19 | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
22 #if USESROUTINEDESCRIPTORS
23 typedef UniversalProcPtr ExtLDEFDrawProcUPP
;
25 #define CallExtLDEFDrawProc(userRoutine, r, cell, lh , refcon ) \
26 CallUniversalProc((UniversalProcPtr)(userRoutine), uppExtLDEFDrawProcInfo, r, cell, lh , refcon )
27 #define NewExtLDEFDrawProc(userRoutine) \
28 (ExtLDEFDrawProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppExtLDEFDrawProcInfo, GetCurrentISA())
31 typedef ExtLDEFDrawProcType ExtLDEFDrawProcUPP
;
33 #define CallExtLDEFDrawProc(userRoutine, r, cell, lh , refcon) \
34 (*(userRoutine))(r, cell, lh, refcon)
35 #define NewExtLDEFDrawProc(userRoutine) \
36 (ExtLDEFDrawProcUPP)(userRoutine)
42 ExtLDEFDrawProcUPP drawProc
;
45 static void NewExtLDEFInfo( ListHandle lh
, ExtLDEFDrawProcType drawproc
, long refcon
) ;
46 static void NewExtLDEFInfo( ListHandle lh
, ExtLDEFDrawProcType drawproc
, long refcon
)
48 ExtLDEFInfo
* info
= (ExtLDEFInfo
* ) malloc( sizeof( ExtLDEFInfo
) ) ;
49 info
->drawProc
= NewExtLDEFDrawProc( drawproc
) ;
50 info
->refCon
= refcon
;
51 (**lh
).refCon
= (long) info
;
54 static void DisposeExtLDEFInfo( ListHandle lh
) ;
55 static void DisposeExtLDEFInfo( ListHandle lh
)
57 ExtLDEFInfo
* info
= (ExtLDEFInfo
* ) (**lh
).refCon
;
61 DisposeRoutineDescriptor( (RoutineDescriptor
*) info
->drawProc
) ;
63 free( (void*) (**lh
).refCon
) ;