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/.
6
7with Files("**"):
8    BUG_COMPONENT = ("Core", "Widget")
9
10with Files("crashtests/*1128214*"):
11    BUG_COMPONENT = ("Core", "Layout")
12
13with Files("crashtests/*303901*"):
14    BUG_COMPONENT = ("Core", "Graphics")
15
16with Files("crashtests/*380359*"):
17    BUG_COMPONENT = ("Core", "Widget")
18
19with Files("reftests/**"):
20    BUG_COMPONENT = ("Core", "Widget: Cocoa")
21
22with Files("reftests/*fallback*"):
23    BUG_COMPONENT = ("Core", "Layout: Form Controls")
24
25with Files("*CompositorWidget*"):
26    BUG_COMPONENT = ("Core", "Graphics")
27
28with Files("*Gfx*"):
29    BUG_COMPONENT = ("Core", "Graphics")
30
31with Files("*FontRange*"):
32    BUG_COMPONENT = ("Core", "Widget: Cocoa")
33
34toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"]
35
36if toolkit in ("android", "cocoa", "gtk", "uikit", "windows"):
37    DIRS += [toolkit]
38
39if toolkit == "cocoa":
40    XPIDL_SOURCES += [
41        "nsIMacDockSupport.idl",
42        "nsIMacFinderProgress.idl",
43        "nsIMacSharingService.idl",
44        "nsIMacWebAppUtils.idl",
45        "nsIStandaloneNativeMenu.idl",
46        "nsITaskbarProgress.idl",
47        "nsITouchBarHelper.idl",
48        "nsITouchBarInput.idl",
49        "nsITouchBarUpdater.idl",
50    ]
51elif toolkit == "gtk":
52    XPIDL_SOURCES += [
53        "nsIApplicationChooser.idl",
54        "nsIGtkTaskbarProgress.idl",
55        "nsITaskbarProgress.idl",
56    ]
57elif toolkit == "windows":
58    XPIDL_SOURCES += [
59        "nsIJumpListBuilder.idl",
60        "nsIJumpListItem.idl",
61        "nsIPrintSettingsWin.idl",
62        "nsITaskbarOverlayIconController.idl",
63        "nsITaskbarPreview.idl",
64        "nsITaskbarPreviewButton.idl",
65        "nsITaskbarPreviewController.idl",
66        "nsITaskbarProgress.idl",
67        "nsITaskbarTabPreview.idl",
68        "nsITaskbarWindowPreview.idl",
69        "nsIWindowsUIUtils.idl",
70        "nsIWinTaskbar.idl",
71    ]
72
73TEST_DIRS += ["tests", "tests/gtest"]
74
75DIRS += ["headless"]
76
77# Don't build the DSO under the 'build' directory as windows does.
78#
79# The DSOs get built in the toolkit dir itself.  Do this so that
80# multiple implementations of widget can be built on the same
81# source tree.
82#
83
84XPIDL_SOURCES += [
85    "nsIAppShell.idl",
86    "nsIBaseWindow.idl",
87    "nsIBidiKeyboard.idl",
88    "nsIClipboard.idl",
89    "nsIClipboardHelper.idl",
90    "nsIClipboardOwner.idl",
91    "nsIColorPicker.idl",
92    "nsIDisplayInfo.idl",
93    "nsIDragService.idl",
94    "nsIDragSession.idl",
95    "nsIFilePicker.idl",
96    "nsIFormatConverter.idl",
97    "nsIGfxInfo.idl",
98    "nsIGfxInfoDebug.idl",
99    "nsIPaper.idl",
100    "nsIPaperMargin.idl",
101    "nsIPrinter.idl",
102    "nsIPrinterList.idl",
103    "nsIPrintSession.idl",
104    "nsIPrintSettings.idl",
105    "nsIPrintSettingsService.idl",
106    "nsIScreen.idl",
107    "nsIScreenManager.idl",
108    "nsISharePicker.idl",
109    "nsISound.idl",
110    "nsISystemStatusBar.idl",
111    "nsITransferable.idl",
112    "nsIUserIdleService.idl",
113    "nsIUserIdleServiceInternal.idl",
114]
115
116XPIDL_MODULE = "widget"
117
118EXPORTS += [
119    "GfxDriverInfo.h",
120    "GfxInfoBase.h",
121    "GfxInfoCollector.h",
122    "InputData.h",
123    "nsBaseAppShell.h",
124    "nsBaseDragService.h",
125    "nsBaseFilePicker.h",
126    "nsBaseScreen.h",
127    "nsBaseWidget.h",
128    "nsIDeviceContextSpec.h",
129    "nsIPrintDialogService.h",
130    "nsIRollupListener.h",
131    "nsIWidget.h",
132    "nsIWidgetListener.h",
133    "nsPaper.h",
134    "nsPrinterListBase.h",
135    "nsUserIdleService.h",
136    "nsWidgetInitData.h",
137    "nsWidgetsCID.h",
138    "PuppetWidget.h",
139]
140
141EXPORTS.mozilla += [
142    "BasicEvents.h",
143    "CommandList.h",
144    "ContentCache.h",
145    "ContentEvents.h",
146    "EventClassList.h",
147    "EventForwards.h",
148    "EventMessageList.h",
149    "FontRange.h",
150    "LookAndFeel.h",
151    "MiscEvents.h",
152    "MouseEvents.h",
153    "TextEventDispatcher.h",
154    "TextEventDispatcherListener.h",
155    "TextEvents.h",
156    "TextRange.h",
157    "TouchEvents.h",
158    "VsyncDispatcher.h",
159    "WidgetUtils.h",
160]
161
162EXPORTS.mozilla.widget += [
163    "CompositorWidget.h",
164    "IconLoader.h",
165    "IMEData.h",
166    "InProcessCompositorWidget.h",
167    "MediaKeysEventSourceFactory.h",
168    "NativeMenu.h",
169    "nsAutoRollup.h",
170    "nsXPLookAndFeel.h",
171    "PuppetBidiKeyboard.h",
172    "RemoteLookAndFeel.h",
173    "Screen.h",
174    "ScreenManager.h",
175    "ThemeChangeKind.h",
176    "WidgetMessageUtils.h",
177]
178
179UNIFIED_SOURCES += [
180    "CompositorWidget.cpp",
181    "ContentCache.cpp",
182    "GfxDriverInfo.cpp",
183    "GfxInfoBase.cpp",
184    "GfxInfoCollector.cpp",
185    "IconLoader.cpp",
186    "IMEData.cpp",
187    "InProcessCompositorWidget.cpp",
188    "InputData.cpp",
189    "nsAutoRollup.cpp",
190    "nsBaseAppShell.cpp",
191    "nsBaseScreen.cpp",
192    "nsClipboardHelper.cpp",
193    "nsClipboardProxy.cpp",
194    "nsColorPickerProxy.cpp",
195    "nsContentProcessWidgetFactory.cpp",
196    "nsDragServiceProxy.cpp",
197    "nsFilePickerProxy.cpp",
198    "nsHTMLFormatConverter.cpp",
199    "nsIWidgetListener.cpp",
200    "nsNativeBasicTheme.cpp",
201    "nsPrimitiveHelpers.cpp",
202    "nsPrintSettingsImpl.cpp",
203    "nsSoundProxy.cpp",
204    "nsTransferable.cpp",
205    "nsUserIdleService.cpp",
206    "nsXPLookAndFeel.cpp",
207    "PuppetBidiKeyboard.cpp",
208    "PuppetWidget.cpp",
209    "RemoteLookAndFeel.cpp",
210    "Screen.cpp",
211    "ScrollbarDrawingMac.cpp",
212    "SharedWidgetUtils.cpp",
213    "TextEventDispatcher.cpp",
214    "TouchResampler.cpp",
215    "VsyncDispatcher.cpp",
216    "WidgetEventImpl.cpp",
217    "WidgetUtils.cpp",
218]
219
220if CONFIG["OS_ARCH"] == "Linux":
221    EXPORTS.mozilla.widget += ["LSBUtils.h"]
222    SOURCES += ["LSBUtils.cpp"]
223
224if CONFIG["MOZ_XUL"] and CONFIG["NS_PRINTING"]:
225    EXPORTS += [
226        "nsDeviceContextSpecProxy.h",
227        "nsPrintSettingsService.h",
228    ]
229    UNIFIED_SOURCES += [
230        "nsDeviceContextSpecProxy.cpp",
231        "nsPaper.cpp",
232        "nsPaperMargin.cpp",
233        "nsPrinterBase.cpp",
234        "nsPrinterListBase.cpp",
235        "nsPrintSession.cpp",
236        "nsPrintSettingsService.cpp",
237    ]
238
239    if toolkit in ("cocoa", "gtk"):
240        UNIFIED_SOURCES += [
241            "nsCUPSShim.cpp",
242            "nsPrinterCUPS.cpp",
243            "nsPrinterListCUPS.cpp",
244        ]
245
246# nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
247# nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
248SOURCES += [
249    "nsBaseDragService.cpp",
250    "nsBaseWidget.cpp",
251    "ScreenManager.cpp",
252]
253
254if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
255    EXPORTS.mozilla += [
256        "WidgetTraceEvent.h",
257    ]
258
259EXPORTS.ipc = ["nsGUIEventIPC.h"]
260
261if CONFIG["MOZ_X11"]:
262    DIRS += ["x11"]
263
264if toolkit in ("cocoa", "windows"):
265    UNIFIED_SOURCES += [
266        "nsBaseClipboard.cpp",
267    ]
268
269if toolkit in {"gtk", "cocoa", "windows", "android", "uikit"}:
270    UNIFIED_SOURCES += [
271        "nsBaseFilePicker.cpp",
272    ]
273
274if toolkit in ("gtk", "windows", "cocoa", "android"):
275    UNIFIED_SOURCES += [
276        "nsNativeTheme.cpp",
277    ]
278
279DEFINES["MOZ_CROSS_PROCESS_IME"] = True
280
281include("/ipc/chromium/chromium-config.mozbuild")
282
283LOCAL_INCLUDES += [
284    "/dom/base",
285    "/dom/ipc",
286    "/gfx/2d",
287    "/layout/base",
288    "/layout/forms",
289    "/layout/generic",
290    "/layout/painting",
291    "/layout/xul",
292    "/layout/xul/tree/",
293    "/view",
294    "/widget",
295    "/widget/headless",
296]
297
298# We use the CUPS headers on Cocoa and GTK, but on GTK we don't depend on there being system headers.
299if toolkit == "gtk":
300    LOCAL_INCLUDES += ["/third_party/cups/include"]
301
302if toolkit == "windows":
303    IPDL_SOURCES = [
304        "headless/HeadlessWidgetTypes.ipdlh",
305        "windows/PCompositorWidget.ipdl",
306        "windows/PlatformWidgetTypes.ipdlh",
307    ]
308elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk" and CONFIG["MOZ_X11"]:
309    IPDL_SOURCES = [
310        "gtk/PCompositorWidget.ipdl",
311        "gtk/PlatformWidgetTypes.ipdlh",
312        "headless/HeadlessWidgetTypes.ipdlh",
313    ]
314else:
315    IPDL_SOURCES = [
316        "generic/PCompositorWidget.ipdl",
317        "generic/PlatformWidgetTypes.ipdlh",
318        "headless/HeadlessWidgetTypes.ipdlh",
319    ]
320
321PREPROCESSED_IPDL_SOURCES += [
322    "LookAndFeelTypes.ipdlh",
323]
324
325LOCAL_INCLUDES += [
326    "/widget/%s" % toolkit,
327]
328FINAL_LIBRARY = "xul"
329
330if CONFIG["MOZ_ENABLE_D3D10_LAYER"]:
331    DEFINES["MOZ_ENABLE_D3D10_LAYER"] = True
332
333CXXFLAGS += CONFIG["TK_CFLAGS"]
334if CONFIG["MOZ_WAYLAND"]:
335    CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
336