1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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/. */
20 * Manages a set of NSViews to cover a LayoutDeviceIntRegion.
26 mozilla::LayoutDeviceIntRegion
Region() { return mRegion
; }
30 * @param aRegion The new region.
31 * @param aCoordinateConverter The nsChildView to use for converting
32 * LayoutDeviceIntRect device pixel coordinates into Cocoa NSRect coordinates.
33 * @param aContainerView The view that's going to be the superview of the
34 * NSViews which will be created for this region.
35 * @param aViewCreationCallback A block that instantiates new NSViews.
36 * @return Whether or not the region changed.
38 bool UpdateRegion(const mozilla::LayoutDeviceIntRegion
& aRegion
,
39 const nsChildView
& aCoordinateConverter
, NSView
* aContainerView
,
40 NSView
* (^aViewCreationCallback
)());
43 * Return an NSView from the region, if there is any.
45 NSView
* GetAnyView() { return mViews
.Length() > 0 ? mViews
[0] : NULL
; }
48 mozilla::LayoutDeviceIntRegion mRegion
;
49 nsTArray
<NSView
*> mViews
;
52 } // namespace mozilla
54 #endif // ViewRegion_h