Mac OS 9
TypeSelect.h
Go to the documentation of this file.
1 
17 #ifndef __TYPESELECT__
18 #define __TYPESELECT__
19 
20 #ifndef __EVENTS__
21 #include <Events.h>
22 #endif
23 
24 #if PRAGMA_ONCE
25 #pragma once
26 #endif
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 #if PRAGMA_IMPORT
34 #pragma import on
35 #endif
36 
37 #if PRAGMA_STRUCT_ALIGN
38 #pragma options align = mac68k
39 #elif PRAGMA_STRUCT_PACKPUSH
40 #pragma pack(push, 2)
41 #elif PRAGMA_STRUCT_PACK
42 #pragma pack(2)
43 #endif
44 
45  typedef SInt16 TSCode;
46  enum
47  {
48  tsPreviousSelectMode = -1,
49  tsNormalSelectMode = 0,
50  tsNextSelectMode = 1
51  };
52 
54  {
55  unsigned long tsrLastKeyTime;
56  ScriptCode tsrScript;
57  Str63 tsrKeyStrokes;
58  };
59  typedef struct TypeSelectRecord TypeSelectRecord;
60  typedef CALLBACK_API(Boolean, IndexToStringProcPtr)(short item,
61  ScriptCode *itemsScript,
62  StringPtr *itemsStringPtr,
63  void *yourDataPtr);
64  typedef STACK_UPP_TYPE(IndexToStringProcPtr) IndexToStringUPP;
73  void
75 
90  Boolean
92 
101  short
102  TypeSelectFindItem(const TypeSelectRecord *tsr, short listSize,
103  TSCode selectMode, IndexToStringUPP getStringProc,
104  void *yourDataPtr);
105 
114  short
115  TypeSelectCompare(const TypeSelectRecord *tsr, ScriptCode testStringScript,
116  StringPtr testStringPtr);
117 
126  IndexToStringUPP
127  NewIndexToStringUPP(IndexToStringProcPtr userRoutine);
128 #if !OPAQUE_UPP_TYPES
129  enum
130  {
131  uppIndexToStringProcInfo = 0x00003F90
132  }; /* pascal 1_byte Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
133 #ifdef __cplusplus
134  inline IndexToStringUPP NewIndexToStringUPP(IndexToStringProcPtr userRoutine)
135  {
136  return (IndexToStringUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
137  uppIndexToStringProcInfo,
138  GetCurrentArchitecture());
139  }
140 #else
141 #define NewIndexToStringUPP(userRoutine) \
142  (IndexToStringUPP) \
143  NewRoutineDescriptor((ProcPtr)(userRoutine), uppIndexToStringProcInfo, \
144  GetCurrentArchitecture())
145 #endif
146 #endif
147 
156  void
157  DisposeIndexToStringUPP(IndexToStringUPP userUPP);
158 #if !OPAQUE_UPP_TYPES
159 #ifdef __cplusplus
160  inline void DisposeIndexToStringUPP(IndexToStringUPP userUPP)
161  {
162  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
163  }
164 #else
165 #define DisposeIndexToStringUPP(userUPP) DisposeRoutineDescriptor(userUPP)
166 #endif
167 #endif
168 
177  Boolean
178  InvokeIndexToStringUPP(short item, ScriptCode *itemsScript,
179  StringPtr *itemsStringPtr, void *yourDataPtr,
180  IndexToStringUPP userUPP);
181 #if !OPAQUE_UPP_TYPES
182 #ifdef __cplusplus
183  inline Boolean InvokeIndexToStringUPP(short item, ScriptCode *itemsScript,
184  StringPtr *itemsStringPtr,
185  void *yourDataPtr,
186  IndexToStringUPP userUPP)
187  {
188  return (Boolean)CALL_FOUR_PARAMETER_UPP(userUPP, uppIndexToStringProcInfo,
189  item, itemsScript, itemsStringPtr,
190  yourDataPtr);
191  }
192 #else
193 #define InvokeIndexToStringUPP(item, itemsScript, itemsStringPtr, yourDataPtr, \
194  userUPP) \
195  (Boolean) \
196  CALL_FOUR_PARAMETER_UPP((userUPP), uppIndexToStringProcInfo, (item), \
197  (itemsScript), (itemsStringPtr), (yourDataPtr))
198 #endif
199 #endif
200 
201 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
202 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
203 #define NewIndexToStringProc(userRoutine) NewIndexToStringUPP(userRoutine)
204 #define CallIndexToStringProc(userRoutine, item, itemsScript, itemsStringPtr, \
205  yourDataPtr) \
206  InvokeIndexToStringUPP(item, itemsScript, itemsStringPtr, yourDataPtr, \
207  userRoutine)
208 #endif /* CALL_NOT_IN_CARBON */
209 
210 #if PRAGMA_STRUCT_ALIGN
211 #pragma options align = reset
212 #elif PRAGMA_STRUCT_PACKPUSH
213 #pragma pack(pop)
214 #elif PRAGMA_STRUCT_PACK
215 #pragma pack()
216 #endif
217 
218 #ifdef PRAGMA_IMPORT_OFF
219 #pragma import off
220 #elif PRAGMA_IMPORT
221 #pragma import reset
222 #endif
223 
224 #ifdef __cplusplus
225 }
226 #endif
227 
228 #endif /* __TYPESELECT__ */
Event Manager Interfaces.
unsigned char * StringPtr
Definition: MacTypes.h:477
unsigned char Boolean
Definition: MacTypes.h:318
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
short TypeSelectFindItem(const TypeSelectRecord *tsr, short listSize, TSCode selectMode, IndexToStringUPP getStringProc, void *yourDataPtr)
void DisposeIndexToStringUPP(IndexToStringUPP userUPP)
short TypeSelectCompare(const TypeSelectRecord *tsr, ScriptCode testStringScript, StringPtr testStringPtr)
Boolean TypeSelectNewKey(const EventRecord *theEvent, TypeSelectRecord *tsr)
IndexToStringUPP NewIndexToStringUPP(IndexToStringProcPtr userRoutine)
Boolean InvokeIndexToStringUPP(short item, ScriptCode *itemsScript, StringPtr *itemsStringPtr, void *yourDataPtr, IndexToStringUPP userUPP)
void TypeSelectClear(TypeSelectRecord *tsr)
Definition: Events.h:224
Definition: TypeSelect.h:54