static char *sccs_id= (sccs_id, "@(#)PictureShape.c	3.6 7/28/92");

//$PictureShape$
#include "Class.h"
#include "PictureShape.h"
#include "Picture.h"

//---- PictureShape ------------------------------------------------------------

MetaImpl(PictureShape, (TP(pict), 0));

PictureShape::PictureShape(Picture *p)
{
    pict= p;
#ifdef ET23
    bbox= pict->Size();
#else
    bbox= pict->bbox;
#endif
}

PictureShape::~PictureShape()
{
    SafeDelete(pict);
}

void PictureShape::Draw(Rectangle)
{
    GrShowPicture(bbox, pict);
}

void PictureShape::Outline(Point p1, Point p2)
{
    Shape::Outline(p1, p2);
    GrStrokeRect(NormRect(p1, p2));
}

#ifdef ET25
OStream& PictureShape::PrintOn(OStream& s)
#else
ostream& PictureShape::PrintOn(ostream& s)
#endif
{
    Shape::PrintOn(s);
    return s << pict;
}

#ifdef ET25
IStream& PictureShape::ReadFrom(IStream& s)
#else
istream& PictureShape::ReadFrom(istream& s)
#endif
{
    Shape::ReadFrom(s);
    SafeDelete(pict);
    return s >> pict;
}
