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