summaryrefslogtreecommitdiffstats
path: root/printing/native_metafile.h
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-18 05:45:51 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-18 05:45:51 +0000
commitf2da4b06dd189750cf2cd1db687b1106dce38ee8 (patch)
tree331027ffd36e5ffd618892e75b78abfedb627028 /printing/native_metafile.h
parentc8477a432601854d4e8e85a85cbbbf79af723ad2 (diff)
downloadchromium_src-f2da4b06dd189750cf2cd1db687b1106dce38ee8.zip
chromium_src-f2da4b06dd189750cf2cd1db687b1106dce38ee8.tar.gz
chromium_src-f2da4b06dd189750cf2cd1db687b1106dce38ee8.tar.bz2
Revert 78666 - Cleanup NativeMetafile (win) interface and EMF class.
- Rename CreateDc to Init() and remove unused argument (all non-test calls were CreateDc(NULL, NULL). [This matches cross platform interface.] - Remove CreateFileBackedDc from the NativeMetafile interface and make InitToFile() in the EMF class. - Remove CreateFromFile from the NativeMetafile interface and make it InitFromFile() in the EMF class. - Move the CloseEmf method into the destructor, making the Emf class a use once class (matches actual use). BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6695013 TBR=vandebo@chromium.org Review URL: http://codereview.chromium.org/6712030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/native_metafile.h')
-rw-r--r--printing/native_metafile.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/printing/native_metafile.h b/printing/native_metafile.h
index 08b3277..a076b32 100644
--- a/printing/native_metafile.h
+++ b/printing/native_metafile.h
@@ -101,6 +101,29 @@ class NativeMetafile {
virtual gfx::NativeDrawingContext context() const = 0;
#if defined(OS_WIN)
+ // Generates a virtual HDC that will record every GDI commands and compile it
+ // in a EMF data stream.
+ // hdc is used to setup the default DPI and color settings. hdc is optional.
+ // rect specifies the dimensions (in .01-millimeter units) of the EMF. rect is
+ // optional.
+ virtual bool CreateDc(gfx::NativeDrawingContext sibling,
+ const RECT* rect) = 0;
+
+ // Similar to the above method but the metafile is backed by a file.
+ virtual bool CreateFileBackedDc(gfx::NativeDrawingContext sibling,
+ const RECT* rect,
+ const FilePath& path) = 0;
+
+ // TODO(maruel): CreateFromFile(). If ever used. Maybe users would like to
+ // have the ability to save web pages to an EMF file? Afterward, it is easy to
+ // convert to PDF or PS.
+ // Load a metafile fromdisk.
+ virtual bool CreateFromFile(const FilePath& metafile_path) = 0;
+
+ // Closes the HDC created by CreateDc() and generates the compiled EMF
+ // data.
+ virtual void CloseEmf() = 0;
+
// "Plays" the EMF buffer in a HDC. It is the same effect as calling the
// original GDI function that were called when recording the EMF. |rect| is in
// "logical units" and is optional. If |rect| is NULL, the natural EMF bounds