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/. */
21 * Manages a set of NSViews to cover a LayoutDeviceIntRegion.
27 mozilla::LayoutDeviceIntRegion
Region() { return mRegion
; }
31 * @param aRegion The new region.
32 * @param aCoordinateConverter The nsChildView to use for converting
33 * LayoutDeviceIntRect device pixel coordinates into Cocoa NSRect
35 * @param aContainerView The view that's going to be the superview of the
36 * NSViews which will be created for this region.
37 * @param aViewCreationCallback A block that instantiates new NSViews.
38 * @return Whether or not the region changed.
40 bool UpdateRegion(const mozilla::LayoutDeviceIntRegion
& aRegion
,
41 const nsChildView
& aCoordinateConverter
,
42 NSView
* aContainerView
, NSView
* (^aViewCreationCallback
)());
45 * Return an NSView from the region, if there is any.
47 NSView
* GetAnyView() { return mViews
.Length() > 0 ? mViews
[0] : NULL
; }
50 mozilla::LayoutDeviceIntRegion mRegion
;
51 nsTArray
<NSView
*> mViews
;
54 } // namespace mozilla
56 #endif // ViewRegion_h