Mac OS 9
GXEnvironment.h
Go to the documentation of this file.
1 
19 #ifndef __GXENVIRONMENT__
20 #define __GXENVIRONMENT__
21 
22 #ifndef __CONDITIONALMACROS__
23 #include <ConditionalMacros.h>
24 #endif
25 
26 #ifndef __MIXEDMODE__
27 #include <MixedMode.h>
28 #endif
29 
30 #ifndef __QUICKDRAW__
31 #include <Quickdraw.h>
32 #endif
33 
34 #ifndef __GXTYPES__
35 #include <GXTypes.h>
36 #endif
37 
38 #ifndef __CMAPPLICATION__
39 #include <CMApplication.h>
40 #endif
41 
42 #if PRAGMA_ONCE
43 #pragma once
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
51 #if PRAGMA_IMPORT
52 #pragma import on
53 #endif
54 
55 #if PRAGMA_STRUCT_ALIGN
56 #pragma options align = mac68k
57 #elif PRAGMA_STRUCT_PACKPUSH
58 #pragma pack(push, 2)
59 #elif PRAGMA_STRUCT_PACK
60 #pragma pack(2)
61 #endif
62 
63 #if defined(__MWERKS__) && TARGET_CPU_68K
64 #pragma push
65 #pragma pointers_in_D0
66 #endif
67 
70  enum
71  {
72  defaultPollingHandlerFlags = 0x00,
73  okToSwitchDuringPollFlag = 0x00,
74  dontSwitchDuringPollFlag = 0x01
75  };
76 
77  typedef long gxPollingHandlerFlags;
78  typedef CALLBACK_API_C(void,
79  gxPollingHandlerProcPtr)(long reference,
80  gxPollingHandlerFlags flags);
81  typedef STACK_UPP_TYPE(gxPollingHandlerProcPtr) gxPollingHandlerUPP;
82 #if CALL_NOT_IN_CARBON
91  gxPollingHandlerUPP
92  NewgxPollingHandlerUPP(gxPollingHandlerProcPtr userRoutine);
93 #if !OPAQUE_UPP_TYPES
94  enum
95  {
96  uppgxPollingHandlerProcInfo = 0x000003C1
97  };
98 #ifdef __cplusplus
99  inline gxPollingHandlerUPP
100  NewgxPollingHandlerUPP(gxPollingHandlerProcPtr userRoutine)
101  {
102  return (gxPollingHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
103  uppgxPollingHandlerProcInfo,
104  GetCurrentArchitecture());
105  }
106 #else
107 #define NewgxPollingHandlerUPP(userRoutine) \
108  (gxPollingHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
109  uppgxPollingHandlerProcInfo, \
110  GetCurrentArchitecture())
111 #endif
112 #endif
113 
122  void
123  DisposegxPollingHandlerUPP(gxPollingHandlerUPP userUPP);
124 #if !OPAQUE_UPP_TYPES
125 #ifdef __cplusplus
126  inline void DisposegxPollingHandlerUPP(gxPollingHandlerUPP userUPP)
127  {
128  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
129  }
130 #else
131 #define DisposegxPollingHandlerUPP(userUPP) DisposeRoutineDescriptor(userUPP)
132 #endif
133 #endif
134 
143  void
144  InvokegxPollingHandlerUPP(long reference, gxPollingHandlerFlags flags,
145  gxPollingHandlerUPP userUPP);
146 #if !OPAQUE_UPP_TYPES
147 #ifdef __cplusplus
148  inline void InvokegxPollingHandlerUPP(long reference,
149  gxPollingHandlerFlags flags,
150  gxPollingHandlerUPP userUPP)
151  {
152  CALL_TWO_PARAMETER_UPP(userUPP, uppgxPollingHandlerProcInfo, reference,
153  flags);
154  }
155 #else
156 #define InvokegxPollingHandlerUPP(reference, flags, userUPP) \
157  CALL_TWO_PARAMETER_UPP((userUPP), uppgxPollingHandlerProcInfo, (reference), \
158  (flags))
159 #endif
160 #endif
161 
162 #endif
164 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
166 #define NewgxPollingHandlerProc(userRoutine) NewgxPollingHandlerUPP(userRoutine)
167 #define CallgxPollingHandlerProc(userRoutine, reference, flags) \
168  InvokegxPollingHandlerUPP(reference, flags, userRoutine)
169 #endif
171 #if CALL_NOT_IN_CARBON
180  gxPollingHandlerUPP
181  GXGetGraphicsPollingHandler(long *reference);
182 
191  void
192  GXSetGraphicsPollingHandler(gxPollingHandlerUPP handler, long reference);
193 
197 #endif
199  enum
200  {
201  gxDefaultOptionsTranslation = 0x0000,
202  gxOptimizedTranslation = 0x0001,
203  gxReplaceLineWidthTranslation = 0x0002,
204  gxSimpleScalingTranslation = 0x0004,
205  gxSimpleGeometryTranslation = 0x0008,
209  gxPostScriptTargetTranslation = 0x0040,
210  gxVectorTargetTranslation = 0x0080,
211  gxPDDTargetTranslation = 0x0100,
212  gxDontConvertPatternsTranslation = 0x1000,
213  gxDontSplitBitmapsTranslation = 0x2000
214  };
215 
216  typedef long gxTranslationOption;
217  enum
218  {
219  gxContainsFormsBegin = 0x0001,
220  gxContainsFormsEnd = 0x0002,
221  gxContainsPostScript = 0x0004,
222  gxContainsEmptyPostScript = 0x0008
223  };
224 
225  typedef long gxTranslationStatistic;
226  enum
227  {
228  gxQuickDrawPictTag = FOUR_CHAR_CODE('pict')
229  };
230 
232  {
234  gxTranslationOption options;
235  Rect srcRect;
236  Point styleStretch;
237 
239  unsigned long dataLength;
240 
243  };
244  typedef struct gxQuickDrawPict gxQuickDrawPict;
246 #if CALL_NOT_IN_CARBON
255  gxViewPort
257 
266  gxViewPort
268 
277  WindowRef
278  GXGetViewPortWindow(gxViewPort portOrder);
279 
289  GDHandle
290  GXGetViewDeviceGDevice(gxViewDevice theDevice);
291 
300  gxViewDevice
302 
312  void
313  GXConvertQDPoint(const Point *shortPt, gxViewPort portOrder, gxPoint *fixedPt);
314 
315 #endif
317  typedef CALLBACK_API_C(OSErr, gxShapeSpoolProcPtr)(gxShape toSpool,
318  long refCon);
320  typedef CALLBACK_API_C(void, gxUserViewPortFilterProcPtr)(gxShape toFilter,
321  gxViewPort portOrder,
322  long refCon);
323  typedef CALLBACK_API_C(long, gxConvertQDFontProcPtr)(gxStyle dst, long txFont,
324  long txFace);
325  typedef STACK_UPP_TYPE(gxShapeSpoolProcPtr) gxShapeSpoolUPP;
326  typedef STACK_UPP_TYPE(gxUserViewPortFilterProcPtr) gxUserViewPortFilterUPP;
327  typedef STACK_UPP_TYPE(gxConvertQDFontProcPtr) gxConvertQDFontUPP;
328 #if CALL_NOT_IN_CARBON
337  gxShapeSpoolUPP
338  NewgxShapeSpoolUPP(gxShapeSpoolProcPtr userRoutine);
339 #if !OPAQUE_UPP_TYPES
340  enum
341  {
342  uppgxShapeSpoolProcInfo = 0x000003E1
343  };
344 #ifdef __cplusplus
345  inline gxShapeSpoolUPP NewgxShapeSpoolUPP(gxShapeSpoolProcPtr userRoutine)
346  {
347  return (gxShapeSpoolUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
348  uppgxShapeSpoolProcInfo,
349  GetCurrentArchitecture());
350  }
351 #else
352 #define NewgxShapeSpoolUPP(userRoutine) \
353  (gxShapeSpoolUPP) \
354  NewRoutineDescriptor((ProcPtr)(userRoutine), uppgxShapeSpoolProcInfo, \
355  GetCurrentArchitecture())
356 #endif
357 #endif
358 
367  gxUserViewPortFilterUPP
368  NewgxUserViewPortFilterUPP(gxUserViewPortFilterProcPtr userRoutine);
369 #if !OPAQUE_UPP_TYPES
370  enum
371  {
372  uppgxUserViewPortFilterProcInfo = 0x00000FC1
373  };
374 #ifdef __cplusplus
375  inline gxUserViewPortFilterUPP
376  NewgxUserViewPortFilterUPP(gxUserViewPortFilterProcPtr userRoutine)
377  {
378  return (gxUserViewPortFilterUPP)NewRoutineDescriptor(
379  (ProcPtr)(userRoutine), uppgxUserViewPortFilterProcInfo,
380  GetCurrentArchitecture());
381  }
382 #else
383 #define NewgxUserViewPortFilterUPP(userRoutine) \
384  (gxUserViewPortFilterUPP) NewRoutineDescriptor( \
385  (ProcPtr)(userRoutine), uppgxUserViewPortFilterProcInfo, \
386  GetCurrentArchitecture())
387 #endif
388 #endif
389 
398  gxConvertQDFontUPP
399  NewgxConvertQDFontUPP(gxConvertQDFontProcPtr userRoutine);
400 #if !OPAQUE_UPP_TYPES
401  enum
402  {
403  uppgxConvertQDFontProcInfo = 0x00000FF1
404  };
405 #ifdef __cplusplus
406  inline gxConvertQDFontUPP
407  NewgxConvertQDFontUPP(gxConvertQDFontProcPtr userRoutine)
408  {
409  return (gxConvertQDFontUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
410  uppgxConvertQDFontProcInfo,
411  GetCurrentArchitecture());
412  }
413 #else
414 #define NewgxConvertQDFontUPP(userRoutine) \
415  (gxConvertQDFontUPP) \
416  NewRoutineDescriptor((ProcPtr)(userRoutine), uppgxConvertQDFontProcInfo, \
417  GetCurrentArchitecture())
418 #endif
419 #endif
420 
429  void
430  DisposegxShapeSpoolUPP(gxShapeSpoolUPP userUPP);
431 #if !OPAQUE_UPP_TYPES
432 #ifdef __cplusplus
433  inline void DisposegxShapeSpoolUPP(gxShapeSpoolUPP userUPP)
434  {
435  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
436  }
437 #else
438 #define DisposegxShapeSpoolUPP(userUPP) DisposeRoutineDescriptor(userUPP)
439 #endif
440 #endif
441 
450  void
451  DisposegxUserViewPortFilterUPP(gxUserViewPortFilterUPP userUPP);
452 #if !OPAQUE_UPP_TYPES
453 #ifdef __cplusplus
454  inline void DisposegxUserViewPortFilterUPP(gxUserViewPortFilterUPP userUPP)
455  {
456  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
457  }
458 #else
459 #define DisposegxUserViewPortFilterUPP(userUPP) \
460  DisposeRoutineDescriptor(userUPP)
461 #endif
462 #endif
463 
472  void
473  DisposegxConvertQDFontUPP(gxConvertQDFontUPP userUPP);
474 #if !OPAQUE_UPP_TYPES
475 #ifdef __cplusplus
476  inline void DisposegxConvertQDFontUPP(gxConvertQDFontUPP userUPP)
477  {
478  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
479  }
480 #else
481 #define DisposegxConvertQDFontUPP(userUPP) DisposeRoutineDescriptor(userUPP)
482 #endif
483 #endif
484 
493  OSErr
494  InvokegxShapeSpoolUPP(gxShape toSpool, long refCon, gxShapeSpoolUPP userUPP);
495 #if !OPAQUE_UPP_TYPES
496 #ifdef __cplusplus
497  inline OSErr InvokegxShapeSpoolUPP(gxShape toSpool, long refCon,
498  gxShapeSpoolUPP userUPP)
499  {
500  return (OSErr)CALL_TWO_PARAMETER_UPP(userUPP, uppgxShapeSpoolProcInfo,
501  toSpool, refCon);
502  }
503 #else
504 #define InvokegxShapeSpoolUPP(toSpool, refCon, userUPP) \
505  (OSErr) CALL_TWO_PARAMETER_UPP((userUPP), uppgxShapeSpoolProcInfo, \
506  (toSpool), (refCon))
507 #endif
508 #endif
509 
518  void
519  InvokegxUserViewPortFilterUPP(gxShape toFilter, gxViewPort portOrder,
520  long refCon, gxUserViewPortFilterUPP userUPP);
521 #if !OPAQUE_UPP_TYPES
522 #ifdef __cplusplus
523  inline void InvokegxUserViewPortFilterUPP(gxShape toFilter,
524  gxViewPort portOrder, long refCon,
525  gxUserViewPortFilterUPP userUPP)
526  {
527  CALL_THREE_PARAMETER_UPP(userUPP, uppgxUserViewPortFilterProcInfo, toFilter,
528  portOrder, refCon);
529  }
530 #else
531 #define InvokegxUserViewPortFilterUPP(toFilter, portOrder, refCon, userUPP) \
532  CALL_THREE_PARAMETER_UPP((userUPP), uppgxUserViewPortFilterProcInfo, \
533  (toFilter), (portOrder), (refCon))
534 #endif
535 #endif
536 
545  long
546  InvokegxConvertQDFontUPP(gxStyle dst, long txFont, long txFace,
547  gxConvertQDFontUPP userUPP);
548 #if !OPAQUE_UPP_TYPES
549 #ifdef __cplusplus
550  inline long InvokegxConvertQDFontUPP(gxStyle dst, long txFont, long txFace,
551  gxConvertQDFontUPP userUPP)
552  {
553  return (long)CALL_THREE_PARAMETER_UPP(userUPP, uppgxConvertQDFontProcInfo,
554  dst, txFont, txFace);
555  }
556 #else
557 #define InvokegxConvertQDFontUPP(dst, txFont, txFace, userUPP) \
558  (long)CALL_THREE_PARAMETER_UPP((userUPP), uppgxConvertQDFontProcInfo, (dst), \
559  (txFont), (txFace))
560 #endif
561 #endif
562 
563 #endif
565 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
567 #define NewgxShapeSpoolProc(userRoutine) NewgxShapeSpoolUPP(userRoutine)
568 #define NewgxUserViewPortFilterProc(userRoutine) \
569  NewgxUserViewPortFilterUPP(userRoutine)
570 #define NewgxConvertQDFontProc(userRoutine) NewgxConvertQDFontUPP(userRoutine)
571 #define CallgxShapeSpoolProc(userRoutine, toSpool, refCon) \
572  InvokegxShapeSpoolUPP(toSpool, refCon, userRoutine)
573 #define CallgxUserViewPortFilterProc(userRoutine, toFilter, portOrder, refCon) \
574  InvokegxUserViewPortFilterUPP(toFilter, portOrder, refCon, userRoutine)
575 #define CallgxConvertQDFontProc(userRoutine, dst, txFont, txFace) \
576  InvokegxConvertQDFontUPP(dst, txFont, txFace, userRoutine)
577 #endif
579  typedef gxShapeSpoolProcPtr gxShapeSpoolFunction;
580  typedef gxUserViewPortFilterProcPtr gxUserViewPortFilter;
581  typedef gxConvertQDFontProcPtr gxConvertQDFontFunction;
584 #if CALL_NOT_IN_CARBON
593  void
595 
605  void
606  GXGetViewPortMouse(gxViewPort portOrder, gxPoint *localPt);
607 
617  gxUserViewPortFilterUPP
618  GXGetViewPortFilter(gxViewPort portOrder, long *refCon);
619 
628  void
629  GXSetViewPortFilter(gxViewPort portOrder, gxUserViewPortFilterUPP filter,
630  long refCon);
631 
641  void
642  GXInstallQDTranslator(GrafPtr port, gxTranslationOption options,
643  const Rect *srcRect, const Rect *dstRect,
644  Point styleStrech, gxShapeSpoolUPP userFunction,
645  void *reference);
646 
655  gxTranslationStatistic
656  GXRemoveQDTranslator(GrafPtr port, gxTranslationStatistic *statistic);
657 
666  gxShape
667  GXConvertPICTToShape(PicHandle pict, gxTranslationOption options,
668  const Rect *srcRect, const Rect *dstRect,
669  Point styleStretch, gxShape destination,
670  gxTranslationStatistic *stats);
671 
682  long
683  GXConvertQDFont(gxStyle theStyle, long txFont, long txFace);
684 
693  gxConvertQDFontUPP
695 
704  void
705  GXSetConvertQDFont(gxConvertQDFontUPP userFunction);
706 
707 #endif
709  typedef unsigned long gxProfilePoolAttributes;
711  {
713  attributes;
714  CMProfileRef profileRef;
718  };
720 
721 #if defined(__MWERKS__) && TARGET_CPU_68K
722 #pragma pop
723 #endif
724 
725 #if PRAGMA_STRUCT_ALIGN
726 #pragma options align = reset
727 #elif PRAGMA_STRUCT_PACKPUSH
728 #pragma pack(pop)
729 #elif PRAGMA_STRUCT_PACK
730 #pragma pack()
731 #endif
732 
733 #ifdef PRAGMA_IMPORT_OFF
734 #pragma import off
735 #elif PRAGMA_IMPORT
736 #pragma import reset
737 #endif
738 
739 #ifdef __cplusplus
740 }
741 #endif
742 
743 #endif
Color Matching Interfaces.
Set up for compiler independent conditionals.
#define NewgxConvertQDFontUPP(userRoutine)
Definition: GXEnvironment.h:414
WindowRef GXGetViewPortWindow(gxViewPort portOrder)
void GXConvertQDPoint(const Point *shortPt, gxViewPort portOrder, gxPoint *fixedPt)
void GXInstallQDTranslator(GrafPtr port, gxTranslationOption options, const Rect *srcRect, const Rect *dstRect, Point styleStrech, gxShapeSpoolUPP userFunction, void *reference)
void GXSetGraphicsPollingHandler(gxPollingHandlerUPP handler, long reference)
void GXGetGlobalMouse(gxPoint *globalPt)
#define NewgxShapeSpoolUPP(userRoutine)
Definition: GXEnvironment.h:352
gxTranslationStatistic GXRemoveQDTranslator(GrafPtr port, gxTranslationStatistic *statistic)
void InvokegxPollingHandlerUPP(long reference, gxPollingHandlerFlags flags, gxPollingHandlerUPP userUPP)
gxViewDevice GXGetGDeviceViewDevice(GDHandle qdGDevice)
void GXSetViewPortFilter(gxViewPort portOrder, gxUserViewPortFilterUPP filter, long refCon)
long InvokegxConvertQDFontUPP(gxStyle dst, long txFont, long txFace, gxConvertQDFontUPP userUPP)
gxConvertQDFontUPP GXGetConvertQDFont(void)
@ gxRasterTargetTranslation
Definition: GXEnvironment.h:208
@ gxLayoutTextTranslation
Definition: GXEnvironment.h:207
@ gxSimpleLinesTranslation
Definition: GXEnvironment.h:206
gxViewPort GXGetWindowViewPort(WindowRef qdWindow)
gxShapeSpoolProcPtr gxShapeSpoolFunction
Definition: GXEnvironment.h:579
typedef CALLBACK_API_C(OSErr, gxShapeSpoolProcPtr)(gxShape toSpool
#define NewgxPollingHandlerUPP(userRoutine)
Definition: GXEnvironment.h:107
void DisposegxShapeSpoolUPP(gxShapeSpoolUPP userUPP)
OSErr InvokegxShapeSpoolUPP(gxShape toSpool, long refCon, gxShapeSpoolUPP userUPP)
void DisposegxPollingHandlerUPP(gxPollingHandlerUPP userUPP)
#define NewgxUserViewPortFilterUPP(userRoutine)
Definition: GXEnvironment.h:383
GDHandle GXGetViewDeviceGDevice(gxViewDevice theDevice)
gxPollingHandlerUPP GXGetGraphicsPollingHandler(long *reference)
void GXGetViewPortMouse(gxViewPort portOrder, gxPoint *localPt)
void GXSetConvertQDFont(gxConvertQDFontUPP userFunction)
void DisposegxConvertQDFontUPP(gxConvertQDFontUPP userUPP)
gxUserViewPortFilterUPP GXGetViewPortFilter(gxViewPort portOrder, long *refCon)
gxViewPort GXNewWindowViewPort(WindowRef qdWindow)
long GXConvertQDFont(gxStyle theStyle, long txFont, long txFace)
void DisposegxUserViewPortFilterUPP(gxUserViewPortFilterUPP userUPP)
gxShape GXConvertPICTToShape(PicHandle pict, gxTranslationOption options, const Rect *srcRect, const Rect *dstRect, Point styleStretch, gxShape destination, gxTranslationStatistic *stats)
unsigned long gxProfilePoolAttributes
Definition: GXEnvironment.h:709
void InvokegxUserViewPortFilterUPP(gxShape toFilter, gxViewPort portOrder, long refCon, gxUserViewPortFilterUPP userUPP)
QuickDraw GX object and constant definitions.
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Interface to Quickdraw Graphics.
Definition: CMApplication.h:403
Definition: Quickdraw.h:2178
Definition: Quickdraw.h:1648
Definition: Quickdraw.h:326
Definition: MacTypes.h:520
Definition: PPCToolbox.h:168
Definition: MacTypes.h:527
Definition: GXTypes.h:869
Definition: GXEnvironment.h:711
CMProfileRef profileRef
Definition: GXEnvironment.h:714
CMProfileIdentifier identifier
Definition: GXEnvironment.h:717
Definition: GXMath.h:61
Definition: GXEnvironment.h:232
gxBitmapDataSourceAlias alias
Definition: GXEnvironment.h:242
gxTranslationOption options
Definition: GXEnvironment.h:234
unsigned long dataLength
Definition: GXEnvironment.h:239