2011-06-24 10:41:16 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 04:12:37 -07:00
|
|
|
* 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/. */
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
#ifndef MOZILLA_GFX_POINT_H_
|
|
|
|
#define MOZILLA_GFX_POINT_H_
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
#include "Types.h"
|
|
|
|
#include "BasePoint.h"
|
|
|
|
#include "BaseSize.h"
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-11-13 20:29:01 -08:00
|
|
|
struct IntPoint :
|
|
|
|
public BasePoint<int32_t, IntPoint> {
|
|
|
|
typedef BasePoint<int32_t, IntPoint> Super;
|
|
|
|
|
|
|
|
IntPoint() : Super() {}
|
|
|
|
IntPoint(int32_t aX, int32_t aY) : Super(aX, aY) {}
|
|
|
|
};
|
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
struct Point :
|
|
|
|
public BasePoint<Float, Point> {
|
|
|
|
typedef BasePoint<Float, Point> Super;
|
2011-11-13 20:29:01 -08:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
Point() : Super() {}
|
|
|
|
Point(Float aX, Float aY) : Super(aX, aY) {}
|
2013-03-04 06:38:11 -08:00
|
|
|
Point(const IntPoint& point) : Super(float(point.x), float(point.y)) {}
|
2011-06-24 10:41:16 -07:00
|
|
|
};
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-11-13 20:29:01 -08:00
|
|
|
struct IntSize :
|
|
|
|
public BaseSize<int32_t, IntSize> {
|
|
|
|
typedef BaseSize<int32_t, IntSize> Super;
|
|
|
|
|
|
|
|
IntSize() : Super() {}
|
|
|
|
IntSize(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {}
|
2011-06-24 10:41:16 -07:00
|
|
|
};
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
struct Size :
|
|
|
|
public BaseSize<Float, Size> {
|
|
|
|
typedef BaseSize<Float, Size> Super;
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
Size() : Super() {}
|
|
|
|
Size(Float aWidth, Float aHeight) : Super(aWidth, aHeight) {}
|
2011-11-21 06:56:24 -08:00
|
|
|
explicit Size(const IntSize& size) :
|
2013-03-04 06:38:11 -08:00
|
|
|
Super(float(size.width), float(size.height)) {}
|
2011-05-26 12:41:33 -07:00
|
|
|
};
|
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
}
|
2011-05-26 12:41:33 -07:00
|
|
|
}
|
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
#endif /* MOZILLA_GFX_POINT_H_ */
|