1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright 2007 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_THICKNESS_H__
12 #define __MOON_THICKNESS_H__
29 Thickness (double uniform
)
37 Thickness (double hori
, double vert
)
45 Thickness (double left
, double top
, double right
, double bottom
)
47 this->bottom
= bottom
;
53 Thickness (const Thickness
&thickness
)
55 bottom
= thickness
.bottom
;
56 right
= thickness
.right
;
57 left
= thickness
.left
;
61 Thickness
operator- ()
63 return Thickness (-left
, -top
, -right
, -bottom
);
66 Thickness
operator+ (const Thickness
&th
)
68 return Thickness (left
+ th
.left
, top
+ th
.top
, right
+ th
.right
, bottom
+ th
.bottom
);
71 Thickness
operator- (const Thickness
&th
)
73 return Thickness (left
- th
.left
, top
- th
.top
, right
- th
.right
, bottom
- th
.bottom
);
78 // Parses @s and return a new Thickness in @t. Returns
79 // true if this was successful, false otherwise.
81 static bool FromStr (const char *s
, Thickness
*t
);
84 #endif /* __MOON_THICKNESS_H__ */