home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / programming / c / asap / region.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  3KB  |  99 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * ARegion wrapper class                                                     *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_ARegion_H
  12. #define ASAP_ARegion_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/Graphics.h>
  19. }
  20.  
  21. class ARegion : public Region
  22. {
  23.  public:
  24.  inline void AndRectRegion(Rectangle * rectangle);
  25.  inline BOOL AndRegionRegion(Region * destRegion);
  26.  inline BOOL ClearRectRegion(Rectangle * rectangle);
  27.  inline void ClearRegion();
  28.  inline void DisposeRegion();
  29.  inline void operator delete(void *);
  30.  inline static ARegion * NewRegion();
  31.  inline void * operator new(size_t);
  32.  inline BOOL OrRectRegion(Rectangle * rectangle);
  33.  inline BOOL OrRegionRegion(Region * destRegion);
  34.  inline BOOL XorRectRegion(Rectangle * rectangle);
  35.  inline BOOL XorRegionRegion(Region * destRegion);
  36. };
  37. //----------------------------------------------------------------------------
  38. void ARegion::AndRectRegion (Rectangle * rectangle)
  39. {
  40.  ::AndRectRegion(this, rectangle);
  41. }
  42. //----------------------------------------------------------------------------
  43. BOOL ARegion::AndRegionRegion (Region * destRegion)
  44. {
  45.  return ::AndRegionRegion(this, destRegion);
  46. }
  47. //----------------------------------------------------------------------------
  48. BOOL ARegion::ClearRectRegion (Rectangle * rectangle)
  49. {
  50.  return ::ClearRectRegion(this, rectangle);
  51. }
  52. //----------------------------------------------------------------------------
  53. void ARegion::ClearRegion ()
  54. {
  55.  ::ClearRegion(this);
  56. }
  57. //----------------------------------------------------------------------------
  58. void ARegion::DisposeRegion ()
  59. {
  60.  ::DisposeRegion(this);
  61. }
  62. //----------------------------------------------------------------------------
  63. void ARegion::operator delete (void *region)
  64. {
  65.  ((ARegion *) region)->DisposeRegion();
  66. }
  67. //----------------------------------------------------------------------------
  68. ARegion * ARegion::NewRegion ()
  69. {
  70.  return (ARegion *) ::NewRegion();
  71. }
  72. //----------------------------------------------------------------------------
  73. void * ARegion::operator new (size_t)
  74. {
  75.  return (ARegion *) ::NewRegion();
  76. }
  77. //----------------------------------------------------------------------------
  78. BOOL ARegion::OrRectRegion (Rectangle * rectangle)
  79. {
  80.  return ::OrRectRegion(this, rectangle);
  81. }
  82. //----------------------------------------------------------------------------
  83. BOOL ARegion::OrRegionRegion (Region * destRegion)
  84. {
  85.  return ::OrRegionRegion(this, destRegion);
  86. }
  87. //----------------------------------------------------------------------------
  88. BOOL ARegion::XorRectRegion (Rectangle * rectangle)
  89. {
  90.  return ::XorRectRegion(this, rectangle);
  91. }
  92. //----------------------------------------------------------------------------
  93. BOOL ARegion::XorRegionRegion (Region * destRegion)
  94. {
  95.  return ::XorRegionRegion(this, destRegion);
  96. }
  97.  
  98. #endif
  99.