Bug 1654678 Part 4 - Make GTK printer enumeration use the unified CUPS code r=jwatt...
[gecko.git] / widget / moz.build
blob916838807a5032f2b22f5ccf738b785ce1bc635c
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 with Files("**"):
8     BUG_COMPONENT = ("Core", "Widget")
10 with Files("crashtests/*1128214*"):
11     BUG_COMPONENT = ("Core", "Layout")
13 with Files("crashtests/*303901*"):
14     BUG_COMPONENT = ("Core", "Graphics")
16 with Files("crashtests/*380359*"):
17     BUG_COMPONENT = ("Core", "Widget")
19 with Files("reftests/**"):
20     BUG_COMPONENT = ("Core", "Widget: Cocoa")
22 with Files("reftests/*fallback*"):
23     BUG_COMPONENT = ("Core", "Layout: Form Controls")
25 with Files("*CompositorWidget*"):
26     BUG_COMPONENT = ("Core", "Graphics")
28 with Files("*Gfx*"):
29     BUG_COMPONENT = ("Core", "Graphics")
31 with Files("*WindowSurface*"):
32     BUG_COMPONENT = ("Core", "Graphics")
34 with Files("*FontRange*"):
35     BUG_COMPONENT = ("Core", "Widget: Cocoa")
37 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
39 if toolkit in ('cocoa', 'android', 'uikit'):
40     DIRS += [toolkit]
42 if toolkit == 'windows':
43     DIRS += ['windows']
45     XPIDL_SOURCES += [
46         'nsIJumpListBuilder.idl',
47         'nsIJumpListItem.idl',
48         'nsIPrintSettingsWin.idl',
49         'nsITaskbarOverlayIconController.idl',
50         'nsITaskbarPreview.idl',
51         'nsITaskbarPreviewButton.idl',
52         'nsITaskbarPreviewController.idl',
53         'nsITaskbarProgress.idl',
54         'nsITaskbarTabPreview.idl',
55         'nsITaskbarWindowPreview.idl',
56         'nsIWindowsUIUtils.idl',
57         'nsIWinTaskbar.idl',
58     ]
59 elif toolkit == 'cocoa':
60     XPIDL_SOURCES += [
61         'nsIMacDockSupport.idl',
62         'nsIMacFinderProgress.idl',
63         'nsIMacSharingService.idl',
64         'nsIMacWebAppUtils.idl',
65         'nsIStandaloneNativeMenu.idl',
66         'nsISystemStatusBar.idl',
67         'nsITaskbarProgress.idl',
68         'nsITouchBarHelper.idl',
69         'nsITouchBarInput.idl',
70         'nsITouchBarUpdater.idl',
71     ]
72     EXPORTS += [
73         'nsINativeMenuService.h',
74     ]
76 TEST_DIRS += [
77     'tests',
78     'tests/gtest'
81 DIRS += ['headless']
83 # Don't build the DSO under the 'build' directory as windows does.
85 # The DSOs get built in the toolkit dir itself.  Do this so that
86 # multiple implementations of widget can be built on the same
87 # source tree.
89 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
90     DIRS += ['gtk']
92     XPIDL_SOURCES += [
93         'nsIGtkTaskbarProgress.idl',
94         'nsITaskbarProgress.idl',
95     ]
97 XPIDL_SOURCES += [
98     'nsIAppShell.idl',
99     'nsIBaseWindow.idl',
100     'nsIBidiKeyboard.idl',
101     'nsIClipboard.idl',
102     'nsIClipboardHelper.idl',
103     'nsIClipboardOwner.idl',
104     'nsIColorPicker.idl',
105     'nsIDisplayInfo.idl',
106     'nsIDragService.idl',
107     'nsIDragSession.idl',
108     'nsIFilePicker.idl',
109     'nsIFormatConverter.idl',
110     'nsIGfxInfo.idl',
111     'nsIGfxInfoDebug.idl',
112     'nsIPaper.idl',
113     'nsIPaperMargin.idl',
114     'nsIPrinter.idl',
115     'nsIPrinterList.idl',
116     'nsIPrintSession.idl',
117     'nsIPrintSettings.idl',
118     'nsIPrintSettingsService.idl',
119     'nsIScreen.idl',
120     'nsIScreenManager.idl',
121     'nsISharePicker.idl',
122     'nsISound.idl',
123     'nsITransferable.idl',
124     'nsIUserIdleService.idl',
125     'nsIUserIdleServiceInternal.idl',
128 XPIDL_MODULE = 'widget'
130 EXPORTS += [
131     'GfxDriverInfo.h',
132     'GfxInfoBase.h',
133     'GfxInfoCollector.h',
134     'InputData.h',
135     'nsBaseAppShell.h',
136     'nsBaseDragService.h',
137     'nsBaseFilePicker.h',
138     'nsBaseScreen.h',
139     'nsBaseWidget.h',
140     'nsIDeviceContextSpec.h',
141     'nsIKeyEventInPluginCallback.h',
142     'nsIPluginWidget.h',
143     'nsIPrintDialogService.h',
144     'nsIRollupListener.h',
145     'nsIWidget.h',
146     'nsIWidgetListener.h',
147     'nsUserIdleService.h',
148     'nsWidgetInitData.h',
149     'nsWidgetsCID.h',
150     'PuppetWidget.h',
153 EXPORTS.mozilla += [
154     'BasicEvents.h',
155     'CommandList.h',
156     'ContentCache.h',
157     'ContentEvents.h',
158     'EventClassList.h',
159     'EventForwards.h',
160     'EventMessageList.h',
161     'FontRange.h',
162     'LookAndFeel.h',
163     'MiscEvents.h',
164     'MouseEvents.h',
165     'ProcInfo.h',
166     'TextEventDispatcher.h',
167     'TextEventDispatcherListener.h',
168     'TextEvents.h',
169     'TextRange.h',
170     'TouchEvents.h',
171     'VsyncDispatcher.h',
172     'WidgetUtils.h',
175 EXPORTS.mozilla.widget += [
176     'CompositorWidget.h',
177     'IMEData.h',
178     'InProcessCompositorWidget.h',
179     'MediaKeysEventSourceFactory.h',
180     'nsAutoRollup.h',
181     'PuppetBidiKeyboard.h',
182     'Screen.h',
183     'ScreenManager.h',
184     'WidgetMessageUtils.h',
185     'WindowSurface.h'
188 UNIFIED_SOURCES += [
189     'CompositorWidget.cpp',
190     'ContentCache.cpp',
191     'GfxDriverInfo.cpp',
192     'GfxInfoBase.cpp',
193     'GfxInfoCollector.cpp',
194     'IMEData.cpp',
195     'InProcessCompositorWidget.cpp',
196     'InputData.cpp',
197     'nsAutoRollup.cpp',
198     'nsBaseAppShell.cpp',
199     'nsBaseScreen.cpp',
200     'nsClipboardHelper.cpp',
201     'nsClipboardProxy.cpp',
202     'nsColorPickerProxy.cpp',
203     'nsContentProcessWidgetFactory.cpp',
204     'nsDragServiceProxy.cpp',
205     'nsFilePickerProxy.cpp',
206     'nsHTMLFormatConverter.cpp',
207     'nsIWidgetListener.cpp',
208     'nsNativeBasicTheme.cpp',
209     'nsPrimitiveHelpers.cpp',
210     'nsPrintSettingsImpl.cpp',
211     'nsSoundProxy.cpp',
212     'nsTransferable.cpp',
213     'nsUserIdleService.cpp',
214     'nsXPLookAndFeel.cpp',
215     'PuppetBidiKeyboard.cpp',
216     'PuppetWidget.cpp',
217     'Screen.cpp',
218     'SharedWidgetUtils.cpp',
219     'TextEventDispatcher.cpp',
220     'VsyncDispatcher.cpp',
221     'WidgetEventImpl.cpp',
222     'WidgetUtils.cpp',
225 if CONFIG['OS_ARCH'] == 'Linux':
226     EXPORTS.mozilla.widget += [
227         'LSBUtils.h'
228     ]
229     SOURCES += [
230         'LSBUtils.cpp'
231     ]
233 if CONFIG['MOZ_XUL'] and CONFIG['NS_PRINTING']:
234     EXPORTS += [
235         'nsDeviceContextSpecProxy.h',
236         'nsPrintSettingsService.h',
237     ]
238     UNIFIED_SOURCES += [
239         'nsDeviceContextSpecProxy.cpp',
240         'nsPaper.cpp',
241         'nsPaperMargin.cpp',
242         'nsPrinterBase.cpp',
243         'nsPrintSession.cpp',
244         'nsPrintSettingsService.cpp',
245     ]
247     if toolkit in ('cocoa', 'gtk'):
248         UNIFIED_SOURCES += [
249             'CUPSPrinterList.cpp',
250             'nsCUPSShim.cpp',
251             'nsPrinterCUPS.cpp',
252         ]
254     # GTK still uses nsPrinter for PS printers.
255     if toolkit == 'gtk':
256         UNIFIED_SOURCES += [
257             'nsPrinter.cpp',
258         ]
260 # nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
261 # nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
262 SOURCES += [
263     'nsBaseDragService.cpp',
264     'nsBaseWidget.cpp',
265     'ScreenManager.cpp',
268 if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
269     EXPORTS.mozilla += [
270         'WidgetTraceEvent.h',
271     ]
273 EXPORTS.ipc = ['nsGUIEventIPC.h']
275 if CONFIG['MOZ_X11']:
276     DIRS += ['x11']
277     SOURCES += [
278         'GfxInfoX11.cpp',
279         'nsShmImage.cpp',
280         'WindowSurfaceX11SHM.cpp',
281     ]
283 if toolkit == 'windows':
284     EXPORTS += [
285         'PluginWidgetProxy.h',
286     ]
287     SOURCES += [
288         'PluginWidgetProxy.cpp',
289     ]
291 if toolkit in ('cocoa', 'windows'):
292     UNIFIED_SOURCES += [
293         'nsBaseClipboard.cpp',
294     ]
296 if toolkit in {'gtk', 'cocoa', 'windows',
297                'android', 'uikit'}:
298     UNIFIED_SOURCES += [
299         'nsBaseFilePicker.cpp',
300     ]
302 if toolkit in ('gtk', 'windows', 'cocoa', 'android'):
303     UNIFIED_SOURCES += [
304         'nsNativeTheme.cpp',
305     ]
306 if toolkit == 'gtk':
307     XPIDL_SOURCES += [
308         'nsIApplicationChooser.idl',
309     ]
311 DEFINES['MOZ_CROSS_PROCESS_IME'] = True
313 include('/ipc/chromium/chromium-config.mozbuild')
315 LOCAL_INCLUDES += [
316     '/dom/base',
317     '/dom/ipc',
318     '/gfx/2d',
319     '/layout/base',
320     '/layout/forms',
321     '/layout/generic',
322     '/layout/painting',
323     '/layout/xul',
324     '/layout/xul/tree/',
325     '/view',
326     '/widget',
327     '/widget/headless',
330 # We use the CUPS headers on Cocoa and GTK, but on GTK we don't depend on there being system headers.
331 if toolkit == 'gtk':
332     LOCAL_INCLUDES += [
333         '/third_party/cups/include'
334     ]
336 if toolkit == 'windows':
337     IPDL_SOURCES = [
338         'headless/HeadlessWidgetTypes.ipdlh',
339         'windows/PCompositorWidget.ipdl',
340         'windows/PlatformWidgetTypes.ipdlh',
341     ]
342 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_X11']:
343     IPDL_SOURCES = [
344         'gtk/PCompositorWidget.ipdl',
345         'gtk/PlatformWidgetTypes.ipdlh',
346         'headless/HeadlessWidgetTypes.ipdlh',
347     ]
348 else:
349     IPDL_SOURCES = [
350         'headless/HeadlessWidgetTypes.ipdlh',
351         'PCompositorWidget.ipdl',
352         'PlatformWidgetTypes.ipdlh',
353     ]
355 LOCAL_INCLUDES += [
356     '/widget/%s' % toolkit,
358 FINAL_LIBRARY = 'xul'
360 if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
361     DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True
363 CXXFLAGS += CONFIG['TK_CFLAGS']
364 if CONFIG['MOZ_WAYLAND']:
365     CXXFLAGS += CONFIG['MOZ_WAYLAND_CFLAGS']