home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594b.lha / Precognition_rel1 / graphicobject.h < prev    next >
C/C++ Source or Header  |  1991-12-12  |  3KB  |  108 lines

  1. /* ==========================================================================
  2. **
  3. **                               GraphicObject.h
  4. **
  5. ** Object<GraphicObject
  6. **
  7. ** A GraphicObject is a virtual class, derrived from class Object.
  8. ** Potentially anything that can be drawn on a RastPort is a
  9. ** graphic object.
  10. **
  11. **
  12. ** ©1991 WILLISoft
  13. **
  14. ** ==========================================================================
  15. */
  16.  
  17. #ifndef GRAPHICOBJECT_H
  18. #define GRAPHICOBJECT_H
  19.  
  20. #include "Object.h"
  21. #include "Intuition_typedefs.h"
  22. #include "Precognition_utils.h"
  23.  
  24. typedef struct GraphicObject
  25.    {
  26.       Class   *isa;
  27.       char    *ObjectName;
  28.       void    *Next;        /* Points to next GraphicObject in chain. */
  29.    } GraphicObject;
  30.  
  31.  
  32.  
  33.  
  34. Point Location( GraphicObject *self );
  35.    /*
  36.    ** Returns the LeftEdge, TopEdge of 'self'.
  37.    */
  38.  
  39.  
  40.  
  41. Point SetLocation( GraphicObject *self,
  42.                    PIXELS         LeftEdge,
  43.                    PIXELS         TopEdge );
  44.    /*
  45.    ** Sets the LeftEdge, TopEdge of 'self'.
  46.    ** Returns the LeftEdge, TopEdge.
  47.    */
  48.  
  49.  
  50. Point Size( GraphicObject *self );
  51.    /*
  52.    ** Returns the Width, Height of 'self'.
  53.    */
  54.  
  55.  
  56. Point AskSize( GraphicObject *self,
  57.                PIXELS         Width,
  58.                PIXELS         Height );
  59.    /*
  60.    ** Given a (Width, Height), returns the nearest (Width, Height)
  61.    ** that 'self' modify itself to be.  Does NOT actually change
  62.    ** the dimensions of 'self'.  (Some graphic objects have
  63.    ** constraints on their size.)
  64.    */
  65.  
  66. #define MinSize(s) AskSize(s,0,0)
  67. #define MaxSize(s) AskSize(s,32767,32767)
  68.  
  69.  
  70. Point SetSize( GraphicObject *self,
  71.                PIXELS         Width,
  72.                PIXELS         Height );
  73.    /*
  74.    ** Sets 'self's size to be as near (Width, Height) as possible,
  75.    ** returns the actual (Width, Height).
  76.    */
  77.  
  78.  
  79. UWORD SizeFlags( GraphicObject *self );
  80.    /*
  81.    ** Returns the flags which define the axis's on which this object may
  82.    ** be sized.
  83.    ** (This is useful for the editor environment)
  84.    */
  85.  
  86. #define OBJSIZE_X 0x0001   /* object can be resized along the X axis. */
  87. #define OBJSIZE_Y 0x0002   /* object can be resized along the Y axis. */
  88.  
  89.  
  90.  
  91. void Render( GraphicObject *self,
  92.              RastPort      *RPort );
  93.  
  94.  
  95.  
  96. /*-- NOTE: Not all GraphicObjects support titles. --*/
  97.  
  98. BOOL SetTitle( GraphicObject *self, char *title );
  99.    /*
  100.    ** returns FALSE if object does not support titles.
  101.    */
  102.  
  103. char *Title( GraphicObject *self );
  104.    /*
  105.    ** Returns a pointer to the title of an object, or NULL if none.
  106.    */
  107.  
  108. #endif