2 * thickness.cpp: Thickness parsing
5 * Moonlight List (moonlight-list@lists.ximian.com)
7 * Copyright 2007 Novell, Inc. (http://www.novell.com)
9 * See the LICENSE file included with the distribution for details.
19 #include "thickness.h"
22 Thickness::FromStr (const char *str
, Thickness
*thickness
)
24 GArray
*values
= double_garray_from_str (str
, 0);
27 switch (values
->len
) {
29 *thickness
= Thickness (g_array_index (values
, double, 0));
32 *thickness
= Thickness (g_array_index (values
, double, 0),
33 g_array_index (values
, double, 1));
36 *thickness
= Thickness (g_array_index (values
, double, 0),
37 g_array_index (values
, double, 1),
38 g_array_index (values
, double, 2),
39 g_array_index (values
, double, 3));
42 g_warning ("Thickness specified with %d values, '%s'.", values
->len
, str
);
48 g_array_free (values
, TRUE
);