5 #ifndef NACL_PLAYER_COMMON_H_ 6 #define NACL_PLAYER_COMMON_H_ 14 namespace NaClPlayer {
28 Point() : x(0), y(0) { }
29 Point(int32_t xx, int32_t yy) : x(xx), y(yy) { }
33 if (
this == &p)
return *
this;
47 Size() : width(0), height(0) { }
48 Size(int32_t w, int32_t h) : width(w), height(h) { }
49 Size(
const Size& s) : width(s.width), height(s.height) { }
52 if (
this == &s)
return *
this;
66 Rect() : position(), size() { }
67 Rect(
const Point& p,
const Size& s) : position(p), size(s) { }
68 Rect(int32_t x, int32_t y, int32_t width, int32_t height)
69 : position(x, y), size(width, height)
73 if (
this == &r)
return *
this;
75 position = r.position;
80 int32_t& x() {
return position.x; }
81 int32_t x()
const {
return position.x; }
83 int32_t& y() {
return position.y; }
84 int32_t y()
const {
return position.y; }
86 int32_t& width() {
return size.width; }
87 int32_t width()
const {
return size.width; }
89 int32_t& height() {
return size.height; }
90 int32_t height()
const {
return size.height; }
99 Rational() : numerator(0), denominator(1) { }
100 Rational(int32_t num, int32_t den) : numerator(num), denominator(den) { }
102 : numerator(r.numerator), denominator(r.denominator)
106 if (
this == &r)
return *
this;
108 numerator = r.numerator;
109 denominator = r.denominator;
117 #endif // NACL_PLAYER_COMMON_H_ Represents 2D rectangle with integral coordinates.
Defines 2D point with integral coordinates.
Defines integral size of 2D rectangle.
double TimeTicks
timestamp in seconds
Represents a rational number.
double TimeDelta
difference of two timestamps in seconds