gfx/thebes/gfxPSSurface.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef GFX_PSSURFACE_H
     7 #define GFX_PSSURFACE_H
     9 #include "gfxASurface.h"
    11 /* for the output stream */
    12 #include "nsCOMPtr.h"
    13 #include "nsIOutputStream.h"
    14 #include "gfxContext.h"
    16 class gfxPSSurface : public gfxASurface {
    17 public:
    18     enum PageOrientation {
    19         PORTRAIT,
    20         LANDSCAPE
    21     };
    23     gfxPSSurface(nsIOutputStream *aStream, const gfxSize& aSizeInPoints, PageOrientation aOrientation);
    24     virtual ~gfxPSSurface();
    26     virtual nsresult BeginPrinting(const nsAString& aTitle, const nsAString& aPrintToFileName);
    27     virtual nsresult EndPrinting();
    28     virtual nsresult AbortPrinting();
    29     virtual nsresult BeginPage();
    30     virtual nsresult EndPage();
    31     virtual void Finish();
    33     void SetDPI(double x, double y);
    34     void GetDPI(double *xDPI, double *yDPI);
    36     virtual bool GetRotateForLandscape() { return (mOrientation == LANDSCAPE); }
    38     // this is in points!
    39     virtual const gfxIntSize GetSize() const
    40     {
    41         return mSize;
    42     }
    44     virtual int32_t GetDefaultContextFlags() const
    45     {
    46         return gfxContext::FLAG_SIMPLIFY_OPERATORS |
    47                gfxContext::FLAG_DISABLE_SNAPPING;
    48     }
    50 private:
    51     nsCOMPtr<nsIOutputStream> mStream;
    52     double mXDPI;
    53     double mYDPI;
    54     gfxIntSize mSize;
    55     PageOrientation mOrientation;
    56 };
    58 #endif /* GFX_PSSURFACE_H */

mercurial