Add printing.dll to the component build.
R=rvargas,thestig Review URL: http://codereview.chromium.org/7799003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99144 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
printing
backend
emf_win.himage.hmetafile.hmetafile_skia_wrapper.hpage_number.hpage_range.hpage_setup.hpdf_metafile_cairo_linux.hpdf_metafile_cg_mac.ccpdf_metafile_cg_mac.hpdf_metafile_skia.hprint_job_constants.hprint_settings.hprint_settings_initializer.hprint_settings_initializer_gtk.hprint_settings_initializer_mac.hprint_settings_initializer_win.hprinted_document.hprinted_page.hprinting.gypprinting_context.hprinting_context_cairo.hprinting_context_mac.hprinting_context_win.hprinting_export.hunits.hwebkit/appcache
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
|
||||
#include <cups/cups.h>
|
||||
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
class GURL;
|
||||
|
||||
// These are helper functions for dealing with CUPS.
|
||||
@ -15,7 +17,7 @@ namespace printing {
|
||||
|
||||
// Helper wrapper around http_t structure, with connection and cleanup
|
||||
// functionality.
|
||||
class HttpConnectionCUPS {
|
||||
class PRINTING_EXPORT HttpConnectionCUPS {
|
||||
public:
|
||||
explicit HttpConnectionCUPS(const GURL& print_server_url);
|
||||
~HttpConnectionCUPS();
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
namespace base {
|
||||
class DictionaryValue;
|
||||
@ -19,7 +20,7 @@ class DictionaryValue;
|
||||
// This is the interface for platform-specific code for a print backend
|
||||
namespace printing {
|
||||
|
||||
struct PrinterBasicInfo {
|
||||
struct PRINTING_EXPORT PrinterBasicInfo {
|
||||
PrinterBasicInfo();
|
||||
~PrinterBasicInfo();
|
||||
|
||||
@ -32,7 +33,7 @@ struct PrinterBasicInfo {
|
||||
|
||||
typedef std::vector<PrinterBasicInfo> PrinterList;
|
||||
|
||||
struct PrinterCapsAndDefaults {
|
||||
struct PRINTING_EXPORT PrinterCapsAndDefaults {
|
||||
PrinterCapsAndDefaults();
|
||||
~PrinterCapsAndDefaults();
|
||||
|
||||
@ -49,7 +50,8 @@ struct PrinterCapsAndDefaults {
|
||||
// print system specific. For example, CUPS is available on both Linux and Mac,
|
||||
// but not available on ChromeOS, etc. This design allows us to add more
|
||||
// functionality on some platforms, while reusing core (CUPS) functions.
|
||||
class PrintBackend : public base::RefCountedThreadSafe<PrintBackend> {
|
||||
class PRINTING_EXPORT PrintBackend
|
||||
: public base::RefCountedThreadSafe<PrintBackend> {
|
||||
public:
|
||||
virtual ~PrintBackend();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -6,11 +6,13 @@
|
||||
#define PRINTING_BACKEND_PRINT_BACKEND_CONSTS_H_
|
||||
#pragma once
|
||||
|
||||
extern const char kLocationTagName[];
|
||||
extern const char kDriverNameTagName[];
|
||||
extern const char kCUPSPrintServerURL[];
|
||||
extern const char kCUPSBlocking[];
|
||||
extern const char kValueTrue[];
|
||||
extern const char kValueFalse[];
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
PRINTING_EXPORT extern const char kLocationTagName[];
|
||||
PRINTING_EXPORT extern const char kDriverNameTagName[];
|
||||
PRINTING_EXPORT extern const char kCUPSPrintServerURL[];
|
||||
PRINTING_EXPORT extern const char kCUPSBlocking[];
|
||||
PRINTING_EXPORT extern const char kValueTrue[];
|
||||
PRINTING_EXPORT extern const char kValueFalse[];
|
||||
|
||||
#endif // PRINTING_BACKEND_PRINT_BACKEND_CONSTS_H_
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#include <xpsprint.h>
|
||||
|
||||
#include "base/string16.h"
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
// These are helper functions for dealing with Windows Printing.
|
||||
namespace printing {
|
||||
@ -21,7 +22,7 @@ namespace printing {
|
||||
// this would mean having to add that to every binary that links with
|
||||
// printing.lib (which is a LOT of binaries). So choosing the GetProcAddress
|
||||
// route instead).
|
||||
class XPSModule {
|
||||
class PRINTING_EXPORT XPSModule {
|
||||
public:
|
||||
// All the other methods can ONLY be called after a successful call to Init.
|
||||
// Init can be called many times and by multiple threads.
|
||||
@ -60,7 +61,7 @@ class XPSModule {
|
||||
};
|
||||
|
||||
// See comments in cc file explaining why we need this.
|
||||
class ScopedXPSInitializer {
|
||||
class PRINTING_EXPORT ScopedXPSInitializer {
|
||||
public:
|
||||
ScopedXPSInitializer();
|
||||
~ScopedXPSInitializer();
|
||||
@ -74,7 +75,7 @@ class ScopedXPSInitializer {
|
||||
// Wrapper class to wrap the XPS Print APIs (these are different from the PTxxx
|
||||
// which deal with the XML Print Schema). This is needed because these
|
||||
// APIs are only available on Windows 7 and higher.
|
||||
class XPSPrintModule {
|
||||
class PRINTING_EXPORT XPSPrintModule {
|
||||
public:
|
||||
// All the other methods can ONLY be called after a successful call to Init.
|
||||
// Init can be called many times and by multiple threads.
|
||||
|
@ -23,7 +23,7 @@ class Size;
|
||||
namespace printing {
|
||||
|
||||
// Simple wrapper class that manage an EMF data stream and its virtual HDC.
|
||||
class Emf : public Metafile {
|
||||
class PRINTING_EXPORT Emf : public Metafile {
|
||||
public:
|
||||
class Record;
|
||||
class Enumerator;
|
||||
@ -118,7 +118,7 @@ struct Emf::EnumerationContext {
|
||||
|
||||
// One EMF record. It keeps pointers to the EMF buffer held by Emf::emf_.
|
||||
// The entries become invalid once Emf::CloseEmf() is called.
|
||||
class Emf::Record {
|
||||
class PRINTING_EXPORT Emf::Record {
|
||||
public:
|
||||
// Plays the record.
|
||||
bool Play() const;
|
||||
@ -144,7 +144,7 @@ class Emf::Record {
|
||||
// Retrieves individual records out of a Emf buffer. The main use is to skip
|
||||
// over records that are unsupported on a specific printer or to play back
|
||||
// only a part of an EMF buffer.
|
||||
class Emf::Enumerator {
|
||||
class PRINTING_EXPORT Emf::Enumerator {
|
||||
public:
|
||||
// Iterator type used for iterating the records.
|
||||
typedef std::vector<Record>::const_iterator const_iterator;
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/logging.h"
|
||||
#include "printing/printing_export.h"
|
||||
#include "ui/gfx/size.h"
|
||||
|
||||
class FilePath;
|
||||
@ -20,7 +21,7 @@ class Metafile;
|
||||
|
||||
// Lightweight raw-bitmap management. The image, once initialized, is immutable.
|
||||
// The main purpose is testing image contents.
|
||||
class Image {
|
||||
class PRINTING_EXPORT Image {
|
||||
public:
|
||||
// Creates the image from the given file on disk. Uses extension to
|
||||
// defer file type. PNG and EMF (on Windows) currently supported.
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "build/build_config.h"
|
||||
#include "printing/printing_export.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@ -37,7 +38,7 @@ namespace printing {
|
||||
|
||||
// This class creates a graphics context that renders into a data stream
|
||||
// (usually PDF or EMF).
|
||||
class Metafile {
|
||||
class PRINTING_EXPORT Metafile {
|
||||
public:
|
||||
virtual ~Metafile() {}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef PRINTING_METAFILE_SKIA_WRAPPER_H_
|
||||
#define PRINTING_METAFILE_SKIA_WRAPPER_H_
|
||||
|
||||
#include "printing/printing_export.h"
|
||||
#include "third_party/skia/include/core/SkRefCnt.h"
|
||||
|
||||
class SkCanvas;
|
||||
@ -17,7 +18,7 @@ class Metafile;
|
||||
// on an SkCanvas. The ownership of the metafile is not affected and it
|
||||
// is the caller's responsibility to ensure that the metafile remains valid
|
||||
// as long as the canvas.
|
||||
class MetafileSkiaWrapper : public SkRefCnt {
|
||||
class PRINTING_EXPORT MetafileSkiaWrapper : public SkRefCnt {
|
||||
public:
|
||||
static void SetMetafileOnCanvas(SkCanvas* canvas, Metafile* metafile);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -15,7 +15,7 @@ class PrintSettings;
|
||||
|
||||
// Represents a page series following the array of page ranges defined in a
|
||||
// PrintSettings.
|
||||
class PageNumber {
|
||||
class PRINTING_EXPORT PageNumber {
|
||||
public:
|
||||
// Initializes the page to the first page in the settings's range or 0.
|
||||
PageNumber(const PrintSettings& settings, int document_page_count);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "printing_export.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
struct PageRange;
|
||||
@ -14,7 +16,7 @@ struct PageRange;
|
||||
typedef std::vector<PageRange> PageRanges;
|
||||
|
||||
// Print range is inclusive. To select one page, set from == to.
|
||||
struct PageRange {
|
||||
struct PRINTING_EXPORT PageRange {
|
||||
int from;
|
||||
int to;
|
||||
|
||||
|
@ -5,12 +5,13 @@
|
||||
#ifndef PRINTING_PAGE_SETUP_H_
|
||||
#define PRINTING_PAGE_SETUP_H_
|
||||
|
||||
#include "printing/printing_export.h"
|
||||
#include "ui/gfx/rect.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
// Margins for a page setup.
|
||||
class PageMargins {
|
||||
class PRINTING_EXPORT PageMargins {
|
||||
public:
|
||||
PageMargins();
|
||||
|
||||
@ -32,7 +33,7 @@ class PageMargins {
|
||||
|
||||
// Settings that define the size and printable areas of a page. Unit is
|
||||
// unspecified.
|
||||
class PageSetup {
|
||||
class PRINTING_EXPORT PageSetup {
|
||||
public:
|
||||
PageSetup();
|
||||
~PageSetup();
|
||||
|
@ -23,7 +23,7 @@ namespace printing {
|
||||
|
||||
// This class uses Cairo graphics library to generate PDF stream and stores
|
||||
// rendering results in a string buffer.
|
||||
class PdfMetafileCairo : public Metafile {
|
||||
class PRINTING_EXPORT PdfMetafileCairo : public Metafile {
|
||||
public:
|
||||
PdfMetafileCairo();
|
||||
virtual ~PdfMetafileCairo();
|
||||
|
@ -52,7 +52,7 @@ PdfMetafileCg::PdfMetafileCg()
|
||||
}
|
||||
|
||||
PdfMetafileCg::~PdfMetafileCg() {
|
||||
DCHECK(CalledOnValidThread());
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
if (pdf_doc_ && thread_pdf_docs.Get()) {
|
||||
// Transfer ownership to the pool.
|
||||
CFSetAddValue(thread_pdf_docs.Get(), pdf_doc_);
|
||||
|
@ -25,7 +25,7 @@ class Point;
|
||||
namespace printing {
|
||||
|
||||
// This class creates a graphics context that renders into a PDF data stream.
|
||||
class PdfMetafileCg : public Metafile, public base::ThreadChecker {
|
||||
class PRINTING_EXPORT PdfMetafileCg : public Metafile {
|
||||
public:
|
||||
PdfMetafileCg();
|
||||
virtual ~PdfMetafileCg();
|
||||
@ -69,6 +69,8 @@ class PdfMetafileCg : public Metafile, public base::ThreadChecker {
|
||||
// Returns a CGPDFDocumentRef version of pdf_data_.
|
||||
CGPDFDocumentRef GetPDFDocument() const;
|
||||
|
||||
base::ThreadChecker thread_checker_;
|
||||
|
||||
// Context for rendering to the pdf.
|
||||
base::mac::ScopedCFTypeRef<CGContextRef> context_;
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace printing {
|
||||
struct PdfMetafileSkiaData;
|
||||
|
||||
// This class uses Skia graphics library to generate a PDF document.
|
||||
class PdfMetafileSkia : public Metafile {
|
||||
class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
|
||||
public:
|
||||
PdfMetafileSkia();
|
||||
virtual ~PdfMetafileSkia();
|
||||
|
@ -5,45 +5,47 @@
|
||||
#ifndef PRINTING_PRINT_JOB_CONSTANTS_H_
|
||||
#define PRINTING_PRINT_JOB_CONSTANTS_H_
|
||||
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
extern const char kIsFirstRequest[];
|
||||
extern const char kPreviewRequestID[];
|
||||
extern const char kPreviewUIAddr[];
|
||||
extern const char kSettingCloudPrintId[];
|
||||
extern const char kSettingCollate[];
|
||||
extern const char kSettingColor[];
|
||||
extern const char kSettingContentHeight[];
|
||||
extern const char kSettingContentWidth[];
|
||||
extern const char kSettingCopies[];
|
||||
extern const char kSettingDefaultMarginsSelected[];
|
||||
extern const char kSettingDeviceName[];
|
||||
extern const char kSettingDuplexMode[];
|
||||
extern const char kSettingGenerateDraftData[];
|
||||
extern const char kSettingHeaderFooterEnabled[];
|
||||
extern const int kSettingHeaderFooterCharacterSpacing;
|
||||
extern const char kSettingHeaderFooterFontFamilyName[];
|
||||
extern const char kSettingHeaderFooterFontName[];
|
||||
extern const int kSettingHeaderFooterFontSize;
|
||||
extern const float kSettingHeaderFooterHorizontalRegions;
|
||||
extern const float kSettingHeaderFooterInterstice;
|
||||
extern const char kSettingHeaderFooterDate[];
|
||||
extern const char kSettingHeaderFooterTitle[];
|
||||
extern const char kSettingHeaderFooterURL[];
|
||||
extern const char kSettingLandscape[];
|
||||
extern const char kSettingMarginBottom[];
|
||||
extern const char kSettingMarginLeft[];
|
||||
extern const char kSettingMarginRight[];
|
||||
extern const char kSettingMarginTop[];
|
||||
extern const char kSettingMargins[];
|
||||
extern const char kSettingPageRange[];
|
||||
extern const char kSettingPageRangeFrom[];
|
||||
extern const char kSettingPageRangeTo[];
|
||||
extern const char kSettingPrinterName[];
|
||||
extern const char kSettingPrintToPDF[];
|
||||
PRINTING_EXPORT extern const char kIsFirstRequest[];
|
||||
PRINTING_EXPORT extern const char kPreviewRequestID[];
|
||||
PRINTING_EXPORT extern const char kPreviewUIAddr[];
|
||||
PRINTING_EXPORT extern const char kSettingCloudPrintId[];
|
||||
PRINTING_EXPORT extern const char kSettingCollate[];
|
||||
PRINTING_EXPORT extern const char kSettingColor[];
|
||||
PRINTING_EXPORT extern const char kSettingContentHeight[];
|
||||
PRINTING_EXPORT extern const char kSettingContentWidth[];
|
||||
PRINTING_EXPORT extern const char kSettingCopies[];
|
||||
PRINTING_EXPORT extern const char kSettingDefaultMarginsSelected[];
|
||||
PRINTING_EXPORT extern const char kSettingDeviceName[];
|
||||
PRINTING_EXPORT extern const char kSettingDuplexMode[];
|
||||
PRINTING_EXPORT extern const char kSettingGenerateDraftData[];
|
||||
PRINTING_EXPORT extern const char kSettingHeaderFooterEnabled[];
|
||||
PRINTING_EXPORT extern const int kSettingHeaderFooterCharacterSpacing;
|
||||
PRINTING_EXPORT extern const char kSettingHeaderFooterFontFamilyName[];
|
||||
PRINTING_EXPORT extern const char kSettingHeaderFooterFontName[];
|
||||
PRINTING_EXPORT extern const int kSettingHeaderFooterFontSize;
|
||||
PRINTING_EXPORT extern const float kSettingHeaderFooterHorizontalRegions;
|
||||
PRINTING_EXPORT extern const float kSettingHeaderFooterInterstice;
|
||||
PRINTING_EXPORT extern const char kSettingHeaderFooterDate[];
|
||||
PRINTING_EXPORT extern const char kSettingHeaderFooterTitle[];
|
||||
PRINTING_EXPORT extern const char kSettingHeaderFooterURL[];
|
||||
PRINTING_EXPORT extern const char kSettingLandscape[];
|
||||
PRINTING_EXPORT extern const char kSettingMarginBottom[];
|
||||
PRINTING_EXPORT extern const char kSettingMarginLeft[];
|
||||
PRINTING_EXPORT extern const char kSettingMarginRight[];
|
||||
PRINTING_EXPORT extern const char kSettingMarginTop[];
|
||||
PRINTING_EXPORT extern const char kSettingMargins[];
|
||||
PRINTING_EXPORT extern const char kSettingPageRange[];
|
||||
PRINTING_EXPORT extern const char kSettingPageRangeFrom[];
|
||||
PRINTING_EXPORT extern const char kSettingPageRangeTo[];
|
||||
PRINTING_EXPORT extern const char kSettingPrinterName[];
|
||||
PRINTING_EXPORT extern const char kSettingPrintToPDF[];
|
||||
|
||||
extern const int FIRST_PAGE_INDEX;
|
||||
extern const int COMPLETE_PREVIEW_DOCUMENT_INDEX;
|
||||
PRINTING_EXPORT extern const int FIRST_PAGE_INDEX;
|
||||
PRINTING_EXPORT extern const int COMPLETE_PREVIEW_DOCUMENT_INDEX;
|
||||
|
||||
// Print job duplex mode values.
|
||||
enum DuplexMode {
|
||||
|
@ -16,7 +16,7 @@
|
||||
namespace printing {
|
||||
|
||||
// OS-independent print settings.
|
||||
class PrintSettings {
|
||||
class PRINTING_EXPORT PrintSettings {
|
||||
public:
|
||||
PrintSettings();
|
||||
~PrintSettings();
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/logging.h"
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
namespace base {
|
||||
class DictionaryValue;
|
||||
@ -18,7 +19,7 @@ class PrintSettings;
|
||||
|
||||
// Initializes the header footer strings in the PrintSettings object from the
|
||||
// provided |job_settings|.
|
||||
class PrintSettingsInitializer {
|
||||
class PRINTING_EXPORT PrintSettingsInitializer {
|
||||
public:
|
||||
static void InitHeaderFooterStrings(
|
||||
const base::DictionaryValue& job_settings,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -16,7 +16,7 @@ namespace printing {
|
||||
class PrintSettings;
|
||||
|
||||
// Initializes a PrintSettings object from the provided Gtk printer objects.
|
||||
class PrintSettingsInitializerGtk {
|
||||
class PRINTING_EXPORT PrintSettingsInitializerGtk {
|
||||
public:
|
||||
static void InitPrintSettings(GtkPrintSettings* settings,
|
||||
GtkPageSetup* page_setup,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -15,7 +15,7 @@ namespace printing {
|
||||
class PrintSettings;
|
||||
|
||||
// Initializes a PrintSettings object from the provided device context.
|
||||
class PrintSettingsInitializerMac {
|
||||
class PRINTING_EXPORT PrintSettingsInitializerMac {
|
||||
public:
|
||||
static void InitPrintSettings(PMPrinter printer,
|
||||
PMPageFormat page_format,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -18,7 +18,7 @@ namespace printing {
|
||||
class PrintSettings;
|
||||
|
||||
// Initializes a PrintSettings object from the provided device context.
|
||||
class PrintSettingsInitializerWin {
|
||||
class PRINTING_EXPORT PrintSettingsInitializerWin {
|
||||
public:
|
||||
static void InitPrintSettings(HDC hdc,
|
||||
const DEVMODE& dev_mode,
|
||||
|
@ -35,7 +35,8 @@ class PrintingContext;
|
||||
// will have write access. Sensible functions are protected by a lock.
|
||||
// Warning: Once a page is loaded, it cannot be replaced. Pages may be discarded
|
||||
// under low memory conditions.
|
||||
class PrintedDocument : public base::RefCountedThreadSafe<PrintedDocument> {
|
||||
class PRINTING_EXPORT PrintedDocument
|
||||
: public base::RefCountedThreadSafe<PrintedDocument> {
|
||||
public:
|
||||
// The cookie shall be unique and has a specific relationship with its
|
||||
// originating source and settings.
|
||||
|
@ -19,7 +19,8 @@ namespace printing {
|
||||
// Note: May be accessed from many threads at the same time. This is an non
|
||||
// issue since this object is immutable. The reason is that a page may be
|
||||
// printed and be displayed at the same time.
|
||||
class PrintedPage : public base::RefCountedThreadSafe<PrintedPage> {
|
||||
class PRINTING_EXPORT PrintedPage
|
||||
: public base::RefCountedThreadSafe<PrintedPage> {
|
||||
public:
|
||||
PrintedPage(int page_number,
|
||||
Metafile* metafile,
|
||||
|
@ -9,7 +9,7 @@
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'printing',
|
||||
'type': 'static_library',
|
||||
'type': '<(component)',
|
||||
'dependencies': [
|
||||
'../base/base.gyp:base',
|
||||
'../base/base.gyp:base_i18n',
|
||||
@ -18,7 +18,10 @@
|
||||
'../skia/skia.gyp:skia',
|
||||
'../third_party/icu/icu.gyp:icui18n',
|
||||
'../third_party/icu/icu.gyp:icuuc',
|
||||
'../ui/ui.gyp:ui', # Only required for Font support.
|
||||
'../ui/ui.gyp:ui',
|
||||
],
|
||||
'defines': [
|
||||
'PRINTING_IMPLEMENTATION',
|
||||
],
|
||||
'include_dirs': [
|
||||
'..',
|
||||
@ -166,6 +169,7 @@
|
||||
'printing',
|
||||
'../testing/gtest.gyp:gtest',
|
||||
'../base/base.gyp:test_support_base',
|
||||
'../ui/ui.gyp:ui',
|
||||
],
|
||||
'sources': [
|
||||
'emf_win_unittest.cc',
|
||||
|
@ -23,7 +23,7 @@ namespace printing {
|
||||
// user selected printing context. This includes the OS-dependent UI to ask the
|
||||
// user about the print settings. Concrete implementations directly talk to the
|
||||
// printer and manage the document and page breaks.
|
||||
class PrintingContext {
|
||||
class PRINTING_EXPORT PrintingContext {
|
||||
public:
|
||||
// Tri-state result for user behavior-dependent functions.
|
||||
enum Result {
|
||||
|
@ -18,7 +18,7 @@ namespace printing {
|
||||
class Metafile;
|
||||
class PrintDialogGtkInterface;
|
||||
|
||||
class PrintingContextCairo : public PrintingContext {
|
||||
class PRINTING_EXPORT PrintingContextCairo : public PrintingContext {
|
||||
public:
|
||||
explicit PrintingContextCairo(const std::string& app_locale);
|
||||
virtual ~PrintingContextCairo();
|
||||
|
@ -19,7 +19,7 @@ class NSPrintInfo;
|
||||
|
||||
namespace printing {
|
||||
|
||||
class PrintingContextMac : public PrintingContext {
|
||||
class PRINTING_EXPORT PrintingContextMac : public PrintingContext {
|
||||
public:
|
||||
explicit PrintingContextMac(const std::string& app_locale);
|
||||
virtual ~PrintingContextMac();
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
namespace printing {
|
||||
|
||||
class PrintingContextWin : public PrintingContext {
|
||||
class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
|
||||
public:
|
||||
explicit PrintingContextWin(const std::string& app_locale);
|
||||
~PrintingContextWin();
|
||||
@ -40,7 +40,7 @@ class PrintingContextWin : public PrintingContext {
|
||||
virtual void ReleaseContext();
|
||||
virtual gfx::NativeDrawingContext context() const;
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
#if defined(UNIT_TEST) || defined(PRINTING_IMPLEMENTATION)
|
||||
// Sets a fake PrintDlgEx function pointer in tests.
|
||||
void SetPrintDialog(HRESULT (__stdcall *print_dialog_func)(LPPRINTDLGEX)) {
|
||||
print_dialog_func_ = print_dialog_func;
|
||||
|
26
printing/printing_export.h
Normal file
26
printing/printing_export.h
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef PRINTING_PRINTING_EXPORT_H_
|
||||
#define PRINTING_PRINTING_EXPORT_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(COMPONENT_BUILD)
|
||||
#if defined(WIN32)
|
||||
|
||||
#if defined(PRINTING_IMPLEMENTATION)
|
||||
#define PRINTING_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define PRINTING_EXPORT __declspec(dllimport)
|
||||
#endif // defined(PRINTING_IMPLEMENTATION)
|
||||
|
||||
#else // defined(WIN32)
|
||||
#define PRINTING_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#else // defined(COMPONENT_BUILD)
|
||||
#define PRINTING_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // PRINTING_PRINTING_EXPORT_H_
|
@ -1,10 +1,12 @@
|
||||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef PRINTING_UNITS_H_
|
||||
#define PRINTING_UNITS_H_
|
||||
|
||||
#include "printing/printing_export.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
// Length of a thousanth of inches in 0.01mm unit.
|
||||
@ -19,29 +21,30 @@ const int kPointsPerInch = 72;
|
||||
const int kPixelsPerInch = 96;
|
||||
|
||||
// Converts from one unit system to another using integer arithmetics.
|
||||
int ConvertUnit(int value, int old_unit, int new_unit);
|
||||
PRINTING_EXPORT int ConvertUnit(int value, int old_unit, int new_unit);
|
||||
|
||||
// Converts from one unit system to another using doubles.
|
||||
double ConvertUnitDouble(double value, double old_unit, double new_unit);
|
||||
PRINTING_EXPORT double ConvertUnitDouble(double value, double old_unit,
|
||||
double new_unit);
|
||||
|
||||
// Converts from 0.001 inch unit to 0.00001 meter.
|
||||
int ConvertMilliInchToHundredThousanthMeter(int milli_inch);
|
||||
PRINTING_EXPORT int ConvertMilliInchToHundredThousanthMeter(int milli_inch);
|
||||
|
||||
// Converts from 0.00001 meter unit to 0.001 inch.
|
||||
int ConvertHundredThousanthMeterToMilliInch(int cmm);
|
||||
PRINTING_EXPORT int ConvertHundredThousanthMeterToMilliInch(int cmm);
|
||||
|
||||
// Converts from 1 pixel to 1 point using integers.
|
||||
int ConvertPixelsToPoint(int pixels);
|
||||
PRINTING_EXPORT int ConvertPixelsToPoint(int pixels);
|
||||
|
||||
// Converts from 1 pixel to 1 point using doubles.
|
||||
double ConvertPixelsToPointDouble(double pixels);
|
||||
PRINTING_EXPORT double ConvertPixelsToPointDouble(double pixels);
|
||||
|
||||
// Converts from 1 point to 1 pixel using doubles.
|
||||
double ConvertPointsToPixelDouble(double points);
|
||||
|
||||
// Splits the horizontal width equally into segments with an interstice
|
||||
// between each segment. Returns the width of a segment.
|
||||
double GetHeaderFooterSegmentWidth(double page_width);
|
||||
PRINTING_EXPORT double GetHeaderFooterSegmentWidth(double page_width);
|
||||
|
||||
} // namespace printing
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
'target_name': 'appcache',
|
||||
'type': 'static_library',
|
||||
'dependencies': [
|
||||
'<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
|
||||
'<(DEPTH)/net/net.gyp:net',
|
||||
'<(DEPTH)/sql/sql.gyp:sql',
|
||||
],
|
||||
|
Reference in New Issue
Block a user