michael@0: michael@0: /* michael@0: * Copyright 2010 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkPDFFormXObject_DEFINED michael@0: #define SkPDFFormXObject_DEFINED michael@0: michael@0: #include "SkPDFStream.h" michael@0: #include "SkPDFTypes.h" michael@0: #include "SkRect.h" michael@0: #include "SkRefCnt.h" michael@0: #include "SkPDFResourceDict.h" michael@0: #include "SkString.h" michael@0: michael@0: class SkMatrix; michael@0: class SkPDFDevice; michael@0: class SkPDFCatalog; michael@0: michael@0: /** \class SkPDFFormXObject michael@0: michael@0: A form XObject; a self contained description of graphics objects. A form michael@0: XObject is basically a page object with slightly different syntax, that michael@0: can be drawn onto a page. michael@0: */ michael@0: michael@0: // The caller could keep track of the form XObjects it creates and michael@0: // canonicalize them, but the Skia API doesn't provide enough context to michael@0: // automatically do it (trivially). michael@0: class SkPDFFormXObject : public SkPDFStream { michael@0: public: michael@0: /** Create a PDF form XObject. Entries for the dictionary entries are michael@0: * automatically added. michael@0: * @param device The set of graphical elements on this form. michael@0: */ michael@0: explicit SkPDFFormXObject(SkPDFDevice* device); michael@0: /** michael@0: * Create a PDF form XObject from a raw content stream and associated michael@0: * resources. michael@0: */ michael@0: explicit SkPDFFormXObject(SkStream* content, michael@0: SkRect bbox, michael@0: SkPDFResourceDict* resourceDict); michael@0: virtual ~SkPDFFormXObject(); michael@0: michael@0: // The SkPDFObject interface. michael@0: virtual void getResources(const SkTSet& knownResourceObjects, michael@0: SkTSet* newResourceObjects); michael@0: michael@0: private: michael@0: void init(const char* colorSpace, michael@0: SkPDFDict* resourceDict, SkPDFArray* bbox); michael@0: michael@0: SkTSet fResources; michael@0: }; michael@0: michael@0: #endif