mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 09:37:31 +09:00
Issue #1925 - Move NS_FOR_CSS_CORNERS and enum to gfx/2d/Types.h.
This commit is contained in:
parent
3a153f32e3
commit
bdb12f10e3
2 changed files with 29 additions and 30 deletions
|
|
@ -406,6 +406,35 @@ static inline Side& operator++(Side& side) {
|
||||||
return side;
|
return side;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace css {
|
||||||
|
enum Corner {
|
||||||
|
// This order is important!
|
||||||
|
eCornerTopLeft = 0,
|
||||||
|
eCornerTopRight = 1,
|
||||||
|
eCornerBottomRight = 2,
|
||||||
|
eCornerBottomLeft = 3,
|
||||||
|
eNumCorners = 4
|
||||||
|
};
|
||||||
|
} // namespace css
|
||||||
|
|
||||||
|
#define NS_CORNER_TOP_LEFT mozilla::css::eCornerTopLeft
|
||||||
|
#define NS_CORNER_TOP_RIGHT mozilla::css::eCornerTopRight
|
||||||
|
#define NS_CORNER_BOTTOM_RIGHT mozilla::css::eCornerBottomRight
|
||||||
|
#define NS_CORNER_BOTTOM_LEFT mozilla::css::eCornerBottomLeft
|
||||||
|
#define NS_NUM_CORNERS mozilla::css::eNumCorners
|
||||||
|
|
||||||
|
#define NS_FOR_CSS_CORNERS(var_) \
|
||||||
|
for (mozilla::css::Corner var_ = NS_CORNER_TOP_LEFT; \
|
||||||
|
var_ <= NS_CORNER_BOTTOM_LEFT; \
|
||||||
|
var_++)
|
||||||
|
|
||||||
|
static inline mozilla::css::Corner operator++(mozilla::css::Corner& corner, int) {
|
||||||
|
MOZ_ASSERT(corner >= NS_CORNER_TOP_LEFT &&
|
||||||
|
corner < NS_NUM_CORNERS, "Out of range corner");
|
||||||
|
corner = mozilla::css::Corner(corner + 1);
|
||||||
|
return corner;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
#endif /* MOZILLA_GFX_TYPES_H_ */
|
#endif /* MOZILLA_GFX_TYPES_H_ */
|
||||||
|
|
|
||||||
|
|
@ -27,36 +27,6 @@ struct gfxMargin : public mozilla::gfx::BaseMargin<gfxFloat, gfxMargin> {
|
||||||
: Super(aTop, aRight, aBottom, aLeft) {}
|
: Super(aTop, aRight, aBottom, aLeft) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
namespace css {
|
|
||||||
enum Corner {
|
|
||||||
// this order is important!
|
|
||||||
eCornerTopLeft = 0,
|
|
||||||
eCornerTopRight = 1,
|
|
||||||
eCornerBottomRight = 2,
|
|
||||||
eCornerBottomLeft = 3,
|
|
||||||
eNumCorners = 4
|
|
||||||
};
|
|
||||||
} // namespace css
|
|
||||||
} // namespace mozilla
|
|
||||||
#define NS_CORNER_TOP_LEFT mozilla::css::eCornerTopLeft
|
|
||||||
#define NS_CORNER_TOP_RIGHT mozilla::css::eCornerTopRight
|
|
||||||
#define NS_CORNER_BOTTOM_RIGHT mozilla::css::eCornerBottomRight
|
|
||||||
#define NS_CORNER_BOTTOM_LEFT mozilla::css::eCornerBottomLeft
|
|
||||||
#define NS_NUM_CORNERS mozilla::css::eNumCorners
|
|
||||||
|
|
||||||
#define NS_FOR_CSS_CORNERS(var_) \
|
|
||||||
for (mozilla::css::Corner var_ = NS_CORNER_TOP_LEFT; \
|
|
||||||
var_ <= NS_CORNER_BOTTOM_LEFT; \
|
|
||||||
var_++)
|
|
||||||
|
|
||||||
static inline mozilla::css::Corner operator++(mozilla::css::Corner& corner, int) {
|
|
||||||
NS_PRECONDITION(corner >= NS_CORNER_TOP_LEFT &&
|
|
||||||
corner < NS_NUM_CORNERS, "Out of range corner");
|
|
||||||
corner = mozilla::css::Corner(corner + 1);
|
|
||||||
return corner;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct gfxRect :
|
struct gfxRect :
|
||||||
public mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> {
|
public mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> {
|
||||||
typedef mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> Super;
|
typedef mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> Super;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue