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 / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Imaging / Shape.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  3.8 KB  |  142 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Shape.cpp
  3.  
  4.     Contains:    ODShape class (Macintosh subclass of ODBaseShape)
  5.  
  6.     Owned by:    Jens Alfke
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <8>     8/26/95    TÇ        1257260 Remove  somInit methods. Don't call
  13.                                     IsInitialized
  14.          <7>     3/20/95    jpa        SOM_CATCH --> SOM_TRY [1224355]
  15.          <6>     12/5/94    jpa        Call Simplify after SetPolygon. Removed
  16.                                     some test code.
  17.          <5>    11/28/94    SS        Merged MacTech branch changes (1198242)
  18.          <4>     8/17/94    jpa        Function prefixes. [1181512]
  19.          <3>     7/26/94    jpa        Added somInit so it could initialize gGX
  20.                                     flag.
  21.          <2>     6/20/94    jpa        Filled in method implementations.
  22.          <1>     6/15/94    jpa        first checked in
  23.  
  24.     To Do:
  25.     In Progress:
  26. */
  27.  
  28.  
  29. #define ODShape_Class_Source
  30. #include <Shape.xih>
  31.  
  32. #ifndef _ODMEMORY_
  33. #include "ODMemory.h"
  34. #endif
  35.  
  36. #ifndef _EXCEPT_
  37. #include "Except.h"
  38. #endif
  39.  
  40. //------------------------------------------------------------------------------
  41. //    InitShape
  42. //------------------------------------------------------------------------------
  43.  
  44. SOM_Scope void  SOMLINK ODShape__InitShape(ODShape *somSelf, Environment *ev)
  45. {
  46.     /* ODShapeData *somThis = ODShapeGetData(somSelf); */
  47.     ODShapeMethodDebug("ODShape","InitShape");
  48.  
  49.     SOM_TRY
  50.     somSelf->InitBaseShape(ev);
  51.  
  52.     SOM_CATCH_ALL
  53.     SOM_ENDTRY
  54. }
  55.  
  56. //------------------------------------------------------------------------------
  57. //    GetQDRegion
  58. //------------------------------------------------------------------------------
  59.  
  60. SOM_Scope ODRgnHandle  SOMLINK ODShape__GetQDRegion(ODShape *somSelf, Environment *ev)
  61. {
  62.     /* ODShapeData *somThis = ODShapeGetData(somSelf); */
  63.     ODShapeMethodDebug("ODShape","GetQDRegion");
  64.  
  65.     SOM_TRY
  66.     return (RgnHandle) somSelf->GetPlatformShape(ev,kODQuickDraw);
  67.  
  68.     SOM_CATCH_ALL
  69.     SOM_ENDTRY
  70.     return kODNULL;
  71. }
  72.  
  73. //------------------------------------------------------------------------------
  74. //    SetQDRegion
  75. //------------------------------------------------------------------------------
  76.  
  77. SOM_Scope void  SOMLINK ODShape__SetQDRegion(ODShape *somSelf, Environment *ev,
  78.         ODRgnHandle rgn)
  79. {
  80.     /* ODShapeData *somThis = ODShapeGetData(somSelf); */
  81.     ODShapeMethodDebug("ODShape","SetQDRegion");
  82.  
  83.     SOM_TRY
  84.     somSelf->SetPlatformShape(ev,kODQuickDraw,(ODPlatformShape)rgn);
  85.  
  86.     SOM_CATCH_ALL
  87.     SOM_ENDTRY
  88. }
  89.  
  90. //------------------------------------------------------------------------------
  91. //    GetGXShape
  92. //------------------------------------------------------------------------------
  93.  
  94. SOM_Scope ODgxShape  SOMLINK ODShape__GetGXShape(ODShape *somSelf, Environment *ev)
  95. {
  96.     /* ODShapeData *somThis = ODShapeGetData(somSelf); */
  97.     ODShapeMethodDebug("ODShape","GetGXShape");
  98.  
  99.     SOM_TRY
  100.     return (gxShape) somSelf->GetPlatformShape(ev,kODQuickDrawGX);
  101.  
  102.     SOM_CATCH_ALL
  103.     SOM_ENDTRY
  104.     return kODNULL;
  105. }
  106.  
  107. //------------------------------------------------------------------------------
  108. //    SetGXShape
  109. //------------------------------------------------------------------------------
  110.  
  111. SOM_Scope void  SOMLINK ODShape__SetGXShape(ODShape *somSelf, Environment *ev,
  112.         ODgxShape s)
  113. {
  114.     /* ODShapeData *somThis = ODShapeGetData(somSelf); */
  115.     ODShapeMethodDebug("ODShape","SetGXShape");
  116.  
  117.     SOM_TRY
  118.     somSelf->SetPlatformShape(ev,kODQuickDrawGX,(ODPlatformShape)s);
  119.  
  120.     SOM_CATCH_ALL
  121.     SOM_ENDTRY
  122. }
  123.  
  124. //------------------------------------------------------------------------------
  125. //    CopyQDRegion
  126. //------------------------------------------------------------------------------
  127.  
  128. SOM_Scope ODRgnHandle  SOMLINK ODShape__CopyQDRegion(ODShape *somSelf, Environment *ev)
  129. {
  130.     /* ODShapeData *somThis = ODShapeGetData(somSelf); */
  131.     ODShapeMethodDebug("ODShape","CopyQDRegion");
  132.     
  133.     SOM_TRY
  134.  
  135.     ODHandle rgn = (ODHandle) somSelf->GetPlatformShape(ev,kODQuickDraw);
  136.     return (RgnHandle) ODCopyHandle(rgn);
  137.  
  138.     SOM_CATCH_ALL
  139.     SOM_ENDTRY
  140.     return kODNULL;
  141. }
  142.