diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-01 06:34:04 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-01 06:34:04 +0000 |
commit | 69f5b1e6690af4184fc5fdc8734ad4b7936123bd (patch) | |
tree | 1ce92b715b5bee418b6d3e88f96a72a2177e4890 /printing | |
parent | 0e3c7d88f2fd4070e0b373e97ce400e522d15245 (diff) | |
download | chromium_src-69f5b1e6690af4184fc5fdc8734ad4b7936123bd.zip chromium_src-69f5b1e6690af4184fc5fdc8734ad4b7936123bd.tar.gz chromium_src-69f5b1e6690af4184fc5fdc8734ad4b7936123bd.tar.bz2 |
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
Diffstat (limited to 'printing')
30 files changed, 146 insertions, 93 deletions
diff --git a/printing/backend/cups_helper.h b/printing/backend/cups_helper.h index 1237468..ee1de9a 100644 --- a/printing/backend/cups_helper.h +++ b/printing/backend/cups_helper.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. @@ -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(); diff --git a/printing/backend/print_backend.h b/printing/backend/print_backend.h index b6d0b91..c788499 100644 --- a/printing/backend/print_backend.h +++ b/printing/backend/print_backend.h @@ -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(); diff --git a/printing/backend/print_backend_consts.h b/printing/backend/print_backend_consts.h index 39555be..51210f6 100644 --- a/printing/backend/print_backend_consts.h +++ b/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. @@ -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_ diff --git a/printing/backend/win_helper.h b/printing/backend/win_helper.h index 28e57f7..a08e69a 100644 --- a/printing/backend/win_helper.h +++ b/printing/backend/win_helper.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. diff --git a/printing/emf_win.h b/printing/emf_win.h index f7e0ed5..f32e184 100644 --- a/printing/emf_win.h +++ b/printing/emf_win.h @@ -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; diff --git a/printing/image.h b/printing/image.h index 3bed218..e34c2c24 100644 --- a/printing/image.h +++ b/printing/image.h @@ -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. diff --git a/printing/metafile.h b/printing/metafile.h index 84c0556..99eb185 100644 --- a/printing/metafile.h +++ b/printing/metafile.h @@ -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() {} diff --git a/printing/metafile_skia_wrapper.h b/printing/metafile_skia_wrapper.h index 127cd1b..40e26e8 100644 --- a/printing/metafile_skia_wrapper.h +++ b/printing/metafile_skia_wrapper.h @@ -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); diff --git a/printing/page_number.h b/printing/page_number.h index 528a41d..a51ad1e 100644 --- a/printing/page_number.h +++ b/printing/page_number.h @@ -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); diff --git a/printing/page_range.h b/printing/page_range.h index 1237d5d..1a68c22 100644 --- a/printing/page_range.h +++ b/printing/page_range.h @@ -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; diff --git a/printing/page_setup.h b/printing/page_setup.h index 0ca1f789..7f33893 100644 --- a/printing/page_setup.h +++ b/printing/page_setup.h @@ -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(); diff --git a/printing/pdf_metafile_cairo_linux.h b/printing/pdf_metafile_cairo_linux.h index 6f07ae0..28c0698 100644 --- a/printing/pdf_metafile_cairo_linux.h +++ b/printing/pdf_metafile_cairo_linux.h @@ -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(); diff --git a/printing/pdf_metafile_cg_mac.cc b/printing/pdf_metafile_cg_mac.cc index 1cf7f7b..5fc8ba3 100644 --- a/printing/pdf_metafile_cg_mac.cc +++ b/printing/pdf_metafile_cg_mac.cc @@ -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_); diff --git a/printing/pdf_metafile_cg_mac.h b/printing/pdf_metafile_cg_mac.h index 5a7f56d..23c00c2 100644 --- a/printing/pdf_metafile_cg_mac.h +++ b/printing/pdf_metafile_cg_mac.h @@ -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_; diff --git a/printing/pdf_metafile_skia.h b/printing/pdf_metafile_skia.h index d4ce56f..4a20c17 100644 --- a/printing/pdf_metafile_skia.h +++ b/printing/pdf_metafile_skia.h @@ -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(); diff --git a/printing/print_job_constants.h b/printing/print_job_constants.h index 7698599..7240340 100644 --- a/printing/print_job_constants.h +++ b/printing/print_job_constants.h @@ -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 { diff --git a/printing/print_settings.h b/printing/print_settings.h index 8fea6dd..23de5b7 100644 --- a/printing/print_settings.h +++ b/printing/print_settings.h @@ -16,7 +16,7 @@ namespace printing { // OS-independent print settings. -class PrintSettings { +class PRINTING_EXPORT PrintSettings { public: PrintSettings(); ~PrintSettings(); diff --git a/printing/print_settings_initializer.h b/printing/print_settings_initializer.h index de2e3cd..4897be8 100644 --- a/printing/print_settings_initializer.h +++ b/printing/print_settings_initializer.h @@ -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, diff --git a/printing/print_settings_initializer_gtk.h b/printing/print_settings_initializer_gtk.h index 7ac252b..5807500 100644 --- a/printing/print_settings_initializer_gtk.h +++ b/printing/print_settings_initializer_gtk.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. @@ -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, diff --git a/printing/print_settings_initializer_mac.h b/printing/print_settings_initializer_mac.h index 75307e1..2b79251 100644 --- a/printing/print_settings_initializer_mac.h +++ b/printing/print_settings_initializer_mac.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. @@ -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, diff --git a/printing/print_settings_initializer_win.h b/printing/print_settings_initializer_win.h index 9ed68e9..720abae 100644 --- a/printing/print_settings_initializer_win.h +++ b/printing/print_settings_initializer_win.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. @@ -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, diff --git a/printing/printed_document.h b/printing/printed_document.h index eb08ae3..67e7f6d 100644 --- a/printing/printed_document.h +++ b/printing/printed_document.h @@ -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. diff --git a/printing/printed_page.h b/printing/printed_page.h index 3771457..fc0d3ba 100644 --- a/printing/printed_page.h +++ b/printing/printed_page.h @@ -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, diff --git a/printing/printing.gyp b/printing/printing.gyp index 0b13a00..256108e 100644 --- a/printing/printing.gyp +++ b/printing/printing.gyp @@ -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', diff --git a/printing/printing_context.h b/printing/printing_context.h index c7184e7..46e9f57 100644 --- a/printing/printing_context.h +++ b/printing/printing_context.h @@ -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 { diff --git a/printing/printing_context_cairo.h b/printing/printing_context_cairo.h index 20c3b8c..088f01b 100644 --- a/printing/printing_context_cairo.h +++ b/printing/printing_context_cairo.h @@ -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(); diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h index 655ef6a..e7e6342 100644 --- a/printing/printing_context_mac.h +++ b/printing/printing_context_mac.h @@ -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(); diff --git a/printing/printing_context_win.h b/printing/printing_context_win.h index c830736..feee8f6 100644 --- a/printing/printing_context_win.h +++ b/printing/printing_context_win.h @@ -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; diff --git a/printing/printing_export.h b/printing/printing_export.h new file mode 100644 index 0000000..2365c01 --- /dev/null +++ b/printing/printing_export.h @@ -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_ diff --git a/printing/units.h b/printing/units.h index bd6d67a..43f68ee 100644 --- a/printing/units.h +++ b/printing/units.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 |