1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright 2008 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_CORNERRADIUS_H__
12 #define __MOON_CORNERRADIUS_H__
24 : topLeft (0), topRight (0),
25 bottomRight (0), bottomLeft (0)
29 CornerRadius (double uniformRadius
)
30 : topLeft (uniformRadius
), topRight (uniformRadius
),
31 bottomRight (uniformRadius
), bottomLeft (uniformRadius
)
35 CornerRadius (double topLeft
, double topRight
,
36 double bottomRight
, double bottomLeft
)
37 : topLeft (topLeft
), topRight (topRight
),
38 bottomRight (bottomRight
), bottomLeft (bottomLeft
)
42 bool operator == (const CornerRadius
&corner
)
44 return fabs (topLeft
-corner
.topLeft
) < DBL_EPSILON
&& fabs (bottomLeft
-corner
.bottomLeft
) < DBL_EPSILON
&& fabs(topRight
-corner
.topRight
) < DBL_EPSILON
&& fabs(bottomRight
-corner
.bottomRight
) < DBL_EPSILON
;
47 bool operator != (const CornerRadius
&corner
)
49 return !(*this == corner
);
54 // Parses @s and return a new CornerRadius in @p. Returns
55 // true if this was successful, false otherwise.
57 static bool FromStr (const char *s
, CornerRadius
*p
);
60 #endif /* __MOON_POINT_H__ */