gecko-dev/widget/windows/moz.build
cku 31ba0da513 Bug 1399787 - Part 3. Create a top level protocol for the PDFium process. r=jwatt
Define ipdl and actor classes. Implementation of actors is added in subsequent
patches.

Control flow:
1. A user starts a printing job.
2. We create a PrintTarget to print web content page by page.
3. When printing pages:
   a. PrintTarget, who lives in the chrome process, create a new FileDescriptor
      and pass that FD to the content process.
   b. The content process renders page contents into the given FD.
   c. PrintTarget render that FD, which contains only one page, into a PDF
      file.
   d. PrintTaget asks PDFium process to convert that PDF file into EMF contents
      by *ConvertToEMF*
   e. The PDFium process converts the given PDF into EMF contents and send back
       EMF contents by *ConvertToEMFDone*
   f. PrintTaget playbacks that EMF onto a printer DC. One page is printed!
   f. If all pages are printed, then finalize print job; Otherwise, loop back
      to #a.

The control flow that we landed in bug 1370488 does not work like the flow
I described above.
In [1], we paint all pages into one single PDF file. After all pages are
rendered into this PDF file, we finalize the current print job, which means the
printing progress dialog is close. *Then* we start to convert that PDF into
EMF and print each EMF page onto printer DC. We can not cancel this conversion
task since the printing dialog is close, there is no UI allow us to do that.
One more serious problem is: since the printing progress dialog is close,
people think that printing is done, but actually it's not.

Except move EMF conversion to a dedicated process, named PDFium process, I will
also fix the behavior we landed in bug 1370488.

[1]
https://hg.mozilla.org/mozilla-central/rev/b611ec2a42bf

MozReview-Commit-ID: JAnmNc3gAVK

--HG--
extra : rebase_source : b6459a187de8e066e7574d2b8757d09fbcfcddba
extra : intermediate-source : 6d6cff8961fa14160b624b2879d231b32c61a8f5
extra : source : b172d78e8c1d801e1e28afd8fedb9fcfff77d113
2017-10-13 16:58:07 +08:00

158 lines
3.6 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Core", "Widget: Win32")
with Files("*CompositorWidget*"):
BUG_COMPONENT = ("Core", "Graphics")
TEST_DIRS += ['tests']
EXPORTS += [
'nsdefs.h',
'WindowHook.h',
'WinUtils.h',
]
EXPORTS.mozilla.widget += [
'AudioSession.h',
'CompositorWidgetChild.h',
'CompositorWidgetParent.h',
'InProcessWinCompositorWidget.h',
'PDFiumChild.h',
'PDFiumEngineShim.h',
'PDFiumParent.h',
'PDFViaEMFPrintHelper.h',
'WinCompositorWidget.h',
'WinMessages.h',
'WinModifierKeyState.h',
'WinNativeEventData.h',
]
UNIFIED_SOURCES += [
'AudioSession.cpp',
'CompositorWidgetChild.cpp',
'CompositorWidgetParent.cpp',
'GfxInfo.cpp',
'IEnumFE.cpp',
'IMMHandler.cpp',
'InkCollector.cpp',
'InProcessWinCompositorWidget.cpp',
'JumpListItem.cpp',
'KeyboardLayout.cpp',
'LSPAnnotator.cpp',
'nsAppShell.cpp',
'nsClipboard.cpp',
'nsColorPicker.cpp',
'nsDataObj.cpp',
'nsDataObjCollection.cpp',
'nsDragService.cpp',
'nsIdleServiceWin.cpp',
'nsImageClipboard.cpp',
'nsLookAndFeel.cpp',
'nsNativeDragSource.cpp',
'nsNativeDragTarget.cpp',
'nsNativeThemeWin.cpp',
'nsSound.cpp',
'nsToolkit.cpp',
'nsUXThemeData.cpp',
'nsWindow.cpp',
'nsWindowBase.cpp',
'nsWindowDbg.cpp',
'nsWindowGfx.cpp',
'nsWinGesture.cpp',
'ScreenHelperWin.cpp',
'TaskbarPreview.cpp',
'TaskbarPreviewButton.cpp',
'TaskbarTabPreview.cpp',
'TaskbarWindowPreview.cpp',
'WidgetTraceEvent.cpp',
'WindowHook.cpp',
'WinIMEHandler.cpp',
'WinPointerEvents.cpp',
'WinTaskbar.cpp',
'WinTextEventDispatcherListener.cpp',
'WinUtils.cpp',
]
# The following files cannot be built in unified mode because of name clashes.
SOURCES += [
'JumpListBuilder.cpp',
'nsBidiKeyboard.cpp',
'nsFilePicker.cpp',
'nsWidgetFactory.cpp',
'WinCompositorWidget.cpp',
'WindowsUIUtils.cpp',
'WinMouseScrollHandler.cpp',
]
if CONFIG['NS_PRINTING']:
UNIFIED_SOURCES += [
'nsDeviceContextSpecWin.cpp',
'nsPrintDialogUtil.cpp',
'nsPrintDialogWin.cpp',
'nsPrintOptionsWin.cpp',
'nsPrintSettingsWin.cpp',
]
if CONFIG['MOZ_ENABLE_SKIA_PDF']:
DIRS += ['/modules/pdfium']
IPDL_SOURCES += [
'PPDFium.ipdl',
]
UNIFIED_SOURCES += [
'PDFiumChild.cpp',
'PDFiumEngineShim.cpp',
'PDFiumParent.cpp',
'PDFViaEMFPrintHelper.cpp',
'WindowsEMF.cpp',
]
if CONFIG['NS_ENABLE_TSF']:
SOURCES += [
'TSFTextStore.cpp',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_ENABLE_SKIA_PDF']:
LOCAL_INCLUDES += [
'/gfx/skia/skia/include/config',
'/gfx/skia/skia/include/core',
'/modules/pdfium/pdfium/public',
]
TEST_DIRS += ['gtest']
LOCAL_INCLUDES += [
'/layout/generic',
'/layout/xul',
'/toolkit/xre',
'/widget',
'/widget/headless',
'/xpcom/base',
]
DEFINES['MOZ_UNICODE'] = True
for var in ('MOZ_ENABLE_D3D10_LAYER'):
if CONFIG[var]:
DEFINES[var] = True
RESFILE = 'widget.res'
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
OS_LIBS += [
'rpcrt4',
]
if CONFIG['_MSC_VER']:
# C5038: Suppress initializer list order warnings from wrl.h
SOURCES['WindowsUIUtils.cpp'].flags += ['-wd5038']