home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Nothing / Sources / Nothing.cpp next >
Encoding:
Text File  |  1995-11-08  |  4.1 KB  |  132 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Nothing.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef NOTHING_H
  11. #include "Nothing.h"
  12. #endif
  13.  
  14. #ifndef NOTHDEF_H
  15. #include "NothDef.h"
  16. #endif
  17.  
  18. // ----- Framework Includes -----
  19.  
  20. #ifndef FWUTIL_H
  21. #include "FWUtil.h"
  22. #endif
  23.  
  24. // ----- OS Layer Includes -----
  25.  
  26. #ifndef FWCFMRES_H
  27. #include "FWCFMRes.h"
  28. #endif
  29.  
  30. #ifndef FWRECSHP_H
  31. #include "FWRecShp.h"
  32. #endif
  33.  
  34. #if FW_LIB_EXPORT_PRAGMAS
  35. #pragma lib_export on
  36. #endif
  37.  
  38. //========================================================================================
  39. //    Runtime informations
  40. //========================================================================================
  41.  
  42. #ifdef FW_BUILD_MAC
  43. #pragma segment odfnothing
  44. #endif
  45.  
  46. //========================================================================================
  47. //    Globals
  48. //========================================================================================
  49.  
  50. const ODValueType CNothingPart::kPartKind = kODFNothingKind;
  51. const ODValueType CNothingPart::kPartUserName = kODFNothingEditorUserString;
  52.  
  53. //========================================================================================
  54. //    CLASS CNothingPart
  55. //========================================================================================
  56.  
  57. //----------------------------------------------------------------------------------------
  58. //     CNothingPart::CNothingPart
  59. //----------------------------------------------------------------------------------------
  60.  
  61. CNothingPart::CNothingPart(ODPart* odPart):
  62.     FW_CPart(odPart, CNothingPart::kPartKind, CNothingPart::kPartUserName, FW_gInstance, kPartIconID)
  63. {
  64. }
  65.  
  66. //----------------------------------------------------------------------------------------
  67. //     CNothingPart::~CNothingPart
  68. //----------------------------------------------------------------------------------------
  69.  
  70. CNothingPart::~CNothingPart()
  71. {
  72. }
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //     CNothingPart::Initialize
  76. //----------------------------------------------------------------------------------------
  77.  
  78. void CNothingPart::Initialize(Environment* ev)
  79. {
  80.     FW_CPart::Initialize(ev);
  81.     
  82.     RegisterPresentation(ev, "Apple:Presentation:ODFNothing", TRUE);
  83. }
  84.  
  85. //----------------------------------------------------------------------------------------
  86. //     CNothingPart::NewFrame
  87. //----------------------------------------------------------------------------------------
  88.  
  89. FW_CFrame* CNothingPart::NewFrame(Environment* ev, 
  90.                                   ODFrame* odFrame, 
  91.                                   FW_CPresentation* presentation, 
  92.                                   FW_Boolean fromStorage)
  93. {
  94. FW_UNUSED(presentation);
  95. FW_UNUSED(fromStorage);
  96.     
  97.     return new CNothingFrame(ev, odFrame, presentation, this);
  98. }
  99.  
  100. //========================================================================================
  101. //    CLASS CNothingFrame
  102. //========================================================================================
  103.  
  104. //----------------------------------------------------------------------------------------
  105. //     CNothingFrame::CNothingFrame
  106. //----------------------------------------------------------------------------------------
  107.  
  108. CNothingFrame::CNothingFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, FW_CPart* part) :
  109.     FW_CFrame(ev, odFrame, presentation, part)
  110. {
  111. }
  112.  
  113. //----------------------------------------------------------------------------------------
  114. //     CNothingFrame::~CNothingFrame
  115. //----------------------------------------------------------------------------------------
  116.  
  117. CNothingFrame::~CNothingFrame()
  118. {
  119. }
  120.  
  121. //----------------------------------------------------------------------------------------
  122. //     CNothingFrame::Draw
  123. //----------------------------------------------------------------------------------------
  124.  
  125. void CNothingFrame::Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape)
  126. {
  127.     FW_CViewContext fc(ev, this, odFacet, invalidShape);
  128.  
  129.     FW_CRect box = GetBounds(ev);    
  130.     FW_CRectShape::RenderRect(fc, box, FW_kFill, FW_kRGBBlue);
  131. }
  132.