4 #include <glib-object.h>
9 #define UNIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_get_type(), Unit))
11 typedef struct UnitPrivate UnitPrivate
;
15 GObject parent_instance
;
21 GObjectClass parent_class
;
24 GType
unit_get_type(void);
26 Unit
*unit_new(const gchar
*name
,
27 const gchar
*display_name
,
29 const gchar
*from_function
,
30 const gchar
*to_function
,
31 const gchar
*symbols
);
33 const gchar
*unit_get_name(Unit
*unit
);
35 const gchar
*unit_get_display_name(Unit
*unit
);
37 gboolean
unit_matches_symbol(Unit
*unit
, const gchar
*symbol
);
39 const GList
*unit_get_symbols(Unit
*unit
);
41 gboolean
unit_convert_from(Unit
*unit
, const MPNumber
*x
, MPNumber
*z
);
43 gboolean
unit_convert_to(Unit
*unit
, const MPNumber
*x
, MPNumber
*z
);
45 gchar
*unit_format(Unit
*unit
, MPNumber
*x
);