~registry/gcalctool/trunk

« back to all changes in this revision

Viewing changes to src/unit.h

  • Committer: Robert Ancell
  • Date: 2012-10-14 03:31:40 UTC
  • Revision ID: git-v1:12ba2c81b0a81bb3ac776d1034a3c41b3173196a
Port to Vala

https://bugzilla.gnome.org/show_bug.cgi?id=640685

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
3
 
 * Copyright (C) 2008-2011 Robert Ancell.
4
 
 * 
5
 
 * This program is free software: you can redistribute it and/or modify it under
6
 
 * the terms of the GNU General Public License as published by the Free Software
7
 
 * Foundation, either version 2 of the License, or (at your option) any later
8
 
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
9
 
 * license.
10
 
 */
11
 
 
12
 
#ifndef UNIT_H
13
 
#define UNIT_H
14
 
 
15
 
#include <glib-object.h>
16
 
#include "mp.h"
17
 
 
18
 
G_BEGIN_DECLS
19
 
 
20
 
#define UNIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_get_type(), Unit))
21
 
 
22
 
typedef struct UnitPrivate UnitPrivate;
23
 
 
24
 
typedef struct
25
 
{
26
 
    GObject parent_instance;
27
 
    UnitPrivate *priv;
28
 
} Unit;
29
 
 
30
 
typedef struct
31
 
{
32
 
    GObjectClass parent_class;
33
 
} UnitClass;
34
 
 
35
 
GType unit_get_type(void);
36
 
 
37
 
Unit *unit_new(const gchar *name,
38
 
               const gchar *display_name,
39
 
               const gchar *format,
40
 
               const gchar *from_function,
41
 
               const gchar *to_function,
42
 
               const gchar *symbols);
43
 
 
44
 
const gchar *unit_get_name(Unit *unit);
45
 
 
46
 
const gchar *unit_get_display_name(Unit *unit);
47
 
 
48
 
gboolean unit_matches_symbol(Unit *unit, const gchar *symbol);
49
 
 
50
 
const GList *unit_get_symbols(Unit *unit);
51
 
 
52
 
gboolean unit_convert_from(Unit *unit, const MPNumber *x, MPNumber *z);
53
 
 
54
 
gboolean unit_convert_to(Unit *unit, const MPNumber *x, MPNumber *z);
55
 
 
56
 
gchar *unit_format(Unit *unit, MPNumber *x);
57
 
 
58
 
G_END_DECLS
59
 
 
60
 
#endif /* UNIT_H */