home *** CD-ROM | disk | FTP | other *** search
-
- // graphics.h.docgraphic
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_docgraphic_H
- #define dreamscape_docgraphic_H
-
- #include "document.h"
- #include "graphic.h"
-
- class DocumentGraphic: public DocumentRedrawable {
- Graphic *graphic;
- DocTransform transform;
-
- public:
- DocumentGraphic(Graphic *graphic = 0);
- virtual ~DocumentGraphic();
-
- void redraw(const RedrawInfo &info) const;
-
- void set_graphic(Graphic *g) { graphic = g; }
- Graphic *get_graphic() const { return graphic; }
-
- void set_transform(const DocTransform &matrix) { transform = matrix; }
- void get_transform(DocTransform &matrix) const { matrix = transform; }
- DocTransform get_transform() const { return transform; }
-
- DocBBox get_bbox() const;
- DocBBox get_transformed_bbox() const
- { return transform.transform(get_bbox()); }
- DocBBox get_transformed_bbox(const DocTransform &matrix) const
- { return matrix.transform(get_bbox()); }
-
- DocCoords get_size() const;
- DocCoords get_transformed_size() const
- { return get_transformed_bbox().size(); }
- DocCoords get_transformed_size(const DocTransform &matrix) const
- { return get_transformed_bbox(matrix).size(); }
- };
-
- #endif
-