home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / SLGC.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.6 KB  |  161 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLGC.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef SLGC_H
  11. #define SLGC_H
  12.  
  13. #ifndef SLGRDEF_H
  14. #include "SLGrDef.h"
  15. #endif
  16.  
  17. #ifndef SLGDEV_H
  18. #include "SLGDev.h"
  19. #endif
  20.  
  21. #ifndef SLMAPING_H
  22. #include "SLMaping.h"
  23. #endif
  24.  
  25. #ifndef SLPTRECT_H
  26. #include "SLPtRect.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Declarations
  31. //========================================================================================
  32.  
  33. class    ODShape;
  34. class    ODCanvas;
  35. class    ODTransform;
  36.  
  37. struct    FW_SPrivSuspendResumeState;
  38. struct    FW_SPrivDeviceState;
  39.  
  40. //========================================================================================
  41. //    struct FW_SGraphicContext
  42. //========================================================================================
  43.  
  44. struct FW_SGraphicContext
  45. {
  46.     FW_Boolean                fInitialized;
  47.  
  48.     Environment*            fEnvironment;
  49.     
  50.     FW_SGraphicContext*        fPreviousGraphicContext;
  51.     
  52.     FW_SMapping                fMapping;
  53.  
  54.     FW_HGDevice                fGraphicDevice;
  55.     ODTransform*            fTransform;
  56.  
  57.     FW_SPrivDeviceState*        fDevicePreviousState;
  58.     FW_SPrivSuspendResumeState*    fDeviceSuspendState;
  59. };
  60.  
  61. //========================================================================================
  62. // Extern C Methods
  63. //========================================================================================
  64.  
  65. // Export or Import functions for CFM-68K [sfu]
  66.  
  67. #if defined(FW_ODFLIB_IMPORT)
  68. #pragma import on
  69. #elif defined(FW_ODFLIB)
  70. #pragma export on
  71. #endif
  72.  
  73. FW_EXTERN_C_BEGIN
  74.  
  75. // The one and only current GC
  76.  
  77. FW_SGraphicContext*    SL_API        FW_PrivGC_GetCurrent(Environment* ev);
  78.  
  79. // Construction/destruction
  80.  
  81. void SL_API                        FW_PrivGC_Clear(Environment* ev, FW_SGraphicContext& gc);
  82. void SL_API                        FW_PrivGC_Initialize(Environment* ev,
  83.                                         FW_SGraphicContext& gc,
  84.                                         FW_HGDevice graphicDevice,
  85.                                         ODTransform* transform,
  86.                                         ODShape* clipShape);
  87. void SL_API                        FW_PrivGC_Terminate(Environment* ev, FW_SGraphicContext& gc);
  88.  
  89. void SL_API                     FW_PrivGC_ChangeClipAndTransform(Environment* ev,
  90.                                         FW_SGraphicContext& gc,
  91.                                         ODTransform* transform,
  92.                                         ODShape* clipShape);
  93. // Clipping
  94.  
  95. ODShape* SL_API                    FW_PrivGC_GetClip(Environment* ev, const FW_SGraphicContext& gc);
  96. void SL_API                        FW_PrivGC_SetClip(Environment* ev, FW_SGraphicContext& gc, ODShape* odShape);
  97.         
  98. void SL_API                        FW_PrivGC_GetClipRect(Environment* ev, const FW_SGraphicContext& gc, FW_SRect& clipRect);
  99. void SL_API                        FW_PrivGC_SetClipRect(Environment* ev, FW_SGraphicContext& gc, const FW_SRect& clipRect);
  100.  
  101. // Coordinate conversion
  102.  
  103. void SL_API                        FW_PrivGC_SetMapping(Environment* ev, FW_SGraphicContext& gc, const FW_SMapping& newMapping);
  104. void SL_API                        FW_PrivGC_GetOriginOffset(Environment* ev, const FW_SGraphicContext& gc, FW_PlatformPoint& offset);
  105.  
  106. // ----- Logical to device
  107.  
  108. void SL_API                        FW_PrivGC_LogicalToDeviceSize(Environment* ev,
  109.                                         const FW_SGraphicContext& gc,
  110.                                         FW_Fixed xSize,
  111.                                         FW_Fixed ySize,
  112.                                         FW_PlatformPoint& ptResult);
  113.  
  114. void SL_API                        FW_PrivGC_LogicalToDevicePoint(Environment* ev,
  115.                                         const FW_SGraphicContext& gc,
  116.                                         const FW_SPoint& point,
  117.                                         FW_PlatformPoint& ptResult);
  118.  
  119. void SL_API                        FW_PrivGC_LogicalToDeviceRect(Environment* ev,
  120.                                         const FW_SGraphicContext& gc,
  121.                                         const FW_SRect& rect,
  122.                                         FW_PlatformRect& rectResult);
  123.  
  124. ODShape* SL_API                    FW_PrivGC_LogicalToDeviceShape(Environment* ev,
  125.                                         const FW_SGraphicContext& gc,
  126.                                         ODShape* shape);
  127.  
  128. // ----- Device to logical
  129.  
  130. void SL_API                        FW_PrivGC_DeviceToLogicalSize(Environment* ev,
  131.                                         const FW_SGraphicContext& gc,
  132.                                         FW_PlatformCoordinate xSize,
  133.                                         FW_PlatformCoordinate ySize,
  134.                                         FW_SPoint& ptResult);
  135.  
  136. void SL_API                        FW_PrivGC_DeviceToLogicalPoint(Environment* ev,
  137.                                         const FW_SGraphicContext& gc,
  138.                                         const FW_PlatformPoint& point,
  139.                                         FW_SPoint& ptResult);
  140.                                             
  141. void SL_API                        FW_PrivGC_DeviceToLogicalRect(Environment* ev,
  142.                                         const FW_SGraphicContext& gc,
  143.                                         const FW_PlatformRect& rect,
  144.                                         FW_SRect& rectResult);
  145.                                         
  146. ODShape* SL_API                    FW_PrivGC_DeviceToLogicalShape(Environment* ev,
  147.                                         const FW_SGraphicContext& gc,
  148.                                         ODShape* region);
  149.  
  150. FW_EXTERN_C_END
  151.  
  152. // For CFM-68K [sfu]
  153.  
  154. #if defined(FW_ODFLIB_IMPORT)
  155. #pragma import off
  156. #elif defined(FW_ODFLIB)
  157. #pragma export off
  158. #endif
  159.  
  160. #endif // SLGC_H
  161.