Bug 1434250 - Infrastructure for working with Box types in Gecko code. r=kats

MozReview-Commit-ID: 5fbTj6vwOwu

--HG--
extra : rebase_source : d9ed5a4c1e75426b612290050f4863b9bb7adc37
This commit is contained in:
Botond Ballo 2018-02-07 12:52:37 -05:00
parent 8cddf32578
commit 82e944293f
3 changed files with 27 additions and 0 deletions

View File

@ -23,6 +23,7 @@ EXPORTS += [
'nsColorNameList.h',
'nsColorNames.h',
'nsCoord.h',
'nsCoordBox.h',
'nsDeviceContext.h',
'nsFont.h',
'nsFontMetrics.h',

24
gfx/src/nsCoordBox.h Normal file
View File

@ -0,0 +1,24 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NSCOORDBOX_H
#define NSCOORDBOX_H
#include "mozilla/gfx/Box.h"
#include "nsCoord.h"
#include "nsRect.h"
// Would like to call this nsBox, but can't because nsBox is a frame type.
struct nsCoordBox :
public mozilla::gfx::BaseBox<nscoord, nsCoordBox, nsRect> {
typedef mozilla::gfx::BaseBox<nscoord, nsCoordBox, nsRect> Super;
nsCoordBox() : Super() {}
nsCoordBox(nscoord aX1, nscoord aY1, nscoord aX2, nscoord aY2) :
Super(aX1, aY1, aX2, aY2) {}
};
#endif /* NSCOORDBOX_H */

View File

@ -7,6 +7,7 @@
#ifndef MOZ_UNITS_H_
#define MOZ_UNITS_H_
#include "mozilla/gfx/Box.h"
#include "mozilla/gfx/Coord.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Rect.h"
@ -74,6 +75,7 @@ typedef gfx::PointTyped<LayerPixel> LayerPoint;
typedef gfx::IntPointTyped<LayerPixel> LayerIntPoint;
typedef gfx::SizeTyped<LayerPixel> LayerSize;
typedef gfx::IntSizeTyped<LayerPixel> LayerIntSize;
typedef gfx::BoxTyped<LayerPixel> LayerBox;
typedef gfx::RectTyped<LayerPixel> LayerRect;
typedef gfx::IntRectTyped<LayerPixel> LayerIntRect;
typedef gfx::MarginTyped<LayerPixel> LayerMargin;