From 6b24c91d3aa81fdb99500c8c2c12f830fabaefb6 Mon Sep 17 00:00:00 2001 From: Steve Zesch Date: Sat, 24 Nov 2012 20:44:45 -0500 Subject: Update codebase. --- src/unit-category.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/unit-category.h (limited to 'src/unit-category.h') diff --git a/src/unit-category.h b/src/unit-category.h new file mode 100644 index 0000000..fc2c739 --- /dev/null +++ b/src/unit-category.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (C) 2008-2011 Robert Ancell. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. See http://www.gnu.org/copyleft/gpl.html the full text of the + * license. + */ + +#ifndef UNIT_CATEGORY_H +#define UNIT_CATEGORY_H + +#include +#include "unit.h" +#include "mp.h" + +G_BEGIN_DECLS + +#define UNIT_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_category_get_type(), UnitCategory)) + +typedef struct UnitCategoryPrivate UnitCategoryPrivate; + +typedef struct +{ + GObject parent_instance; + UnitCategoryPrivate *priv; +} UnitCategory; + +typedef struct +{ + GObjectClass parent_class; +} UnitCategoryClass; + +GType unit_category_get_type(void); + +UnitCategory *unit_category_new(const gchar *name, const gchar *display_name); + +const gchar *unit_category_get_name(UnitCategory *category); + +const gchar *unit_category_get_display_name(UnitCategory *category); + +Unit *unit_category_get_unit_by_name(UnitCategory *category, const gchar *name); + +Unit *unit_category_get_unit_by_symbol(UnitCategory *category, const gchar *symbol); + +void unit_category_add_unit(UnitCategory *category, Unit *unit); + +const GList *unit_category_get_units(UnitCategory *category); + +gboolean unit_category_convert(UnitCategory *category, const MPNumber *x, Unit *x_units, Unit *z_units, MPNumber *z); + +G_END_DECLS + +#endif /* UNIT_CATEGORY_H */ -- cgit v1.2.1