1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/pdf/SkPDFFormXObject.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2010 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkPDFFormXObject_DEFINED 1.14 +#define SkPDFFormXObject_DEFINED 1.15 + 1.16 +#include "SkPDFStream.h" 1.17 +#include "SkPDFTypes.h" 1.18 +#include "SkRect.h" 1.19 +#include "SkRefCnt.h" 1.20 +#include "SkPDFResourceDict.h" 1.21 +#include "SkString.h" 1.22 + 1.23 +class SkMatrix; 1.24 +class SkPDFDevice; 1.25 +class SkPDFCatalog; 1.26 + 1.27 +/** \class SkPDFFormXObject 1.28 + 1.29 + A form XObject; a self contained description of graphics objects. A form 1.30 + XObject is basically a page object with slightly different syntax, that 1.31 + can be drawn onto a page. 1.32 +*/ 1.33 + 1.34 +// The caller could keep track of the form XObjects it creates and 1.35 +// canonicalize them, but the Skia API doesn't provide enough context to 1.36 +// automatically do it (trivially). 1.37 +class SkPDFFormXObject : public SkPDFStream { 1.38 +public: 1.39 + /** Create a PDF form XObject. Entries for the dictionary entries are 1.40 + * automatically added. 1.41 + * @param device The set of graphical elements on this form. 1.42 + */ 1.43 + explicit SkPDFFormXObject(SkPDFDevice* device); 1.44 + /** 1.45 + * Create a PDF form XObject from a raw content stream and associated 1.46 + * resources. 1.47 + */ 1.48 + explicit SkPDFFormXObject(SkStream* content, 1.49 + SkRect bbox, 1.50 + SkPDFResourceDict* resourceDict); 1.51 + virtual ~SkPDFFormXObject(); 1.52 + 1.53 + // The SkPDFObject interface. 1.54 + virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects, 1.55 + SkTSet<SkPDFObject*>* newResourceObjects); 1.56 + 1.57 +private: 1.58 + void init(const char* colorSpace, 1.59 + SkPDFDict* resourceDict, SkPDFArray* bbox); 1.60 + 1.61 + SkTSet<SkPDFObject*> fResources; 1.62 +}; 1.63 + 1.64 +#endif