[CPML] Removed dependency on alloca
[adg.git] / adg / adg-dim.h
blob462c07a353828ffee628cc16112869137914d32d
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009,2010 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #if !defined(__ADG_H__)
22 #error "Only <adg/adg.h> can be included directly."
23 #endif
26 #ifndef __ADG_DIM_H__
27 #define __ADG_DIM_H__
29 #include <adg/adg-alignment.h>
30 #include <adg/adg-model.h>
31 #include <adg/adg-enums.h>
34 G_BEGIN_DECLS
36 #define ADG_TYPE_DIM (adg_dim_get_type())
37 #define ADG_DIM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_TYPE_DIM, AdgDim))
38 #define ADG_DIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_TYPE_DIM, AdgDimClass))
39 #define ADG_IS_DIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_TYPE_DIM))
40 #define ADG_IS_DIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_TYPE_DIM))
41 #define ADG_DIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_TYPE_DIM, AdgDimClass))
43 typedef struct _AdgDim AdgDim;
44 typedef struct _AdgDimClass AdgDimClass;
46 struct _AdgDim {
47 /*< private >*/
48 AdgEntity parent;
49 gpointer data;
52 struct _AdgDimClass {
53 /*< private >*/
54 AdgEntityClass parent_class;
55 /*< public >*/
56 /* Virtual Table */
57 gdouble (*quote_angle) (gdouble angle);
58 gchar * (*default_value) (AdgDim *dim);
62 GType adg_dim_get_type (void) G_GNUC_CONST;
63 AdgDress adg_dim_get_dim_dress (AdgDim *dim);
64 void adg_dim_set_dim_dress (AdgDim *dim,
65 AdgDress dress);
66 void adg_dim_set_ref (AdgDim *dim,
67 const AdgPair *ref1,
68 const AdgPair *ref2);
69 void adg_dim_set_ref_explicit (AdgDim *dim,
70 gdouble ref1_x,
71 gdouble ref1_y,
72 gdouble ref2_x,
73 gdouble ref2_y);
74 void adg_dim_set_ref_from_model (AdgDim *dim,
75 AdgModel *model,
76 const gchar *ref1,
77 const gchar *ref2);
78 const AdgPair * adg_dim_get_ref1 (AdgDim *dim);
79 const AdgPair * adg_dim_get_ref2 (AdgDim *dim);
80 void adg_dim_set_pos (AdgDim *dim,
81 const AdgPair *pos);
82 void adg_dim_set_pos_explicit (AdgDim *dim,
83 gdouble x,
84 gdouble y);
85 void adg_dim_set_pos_from_model (AdgDim *dim,
86 AdgModel *model,
87 const gchar *pos);
88 const AdgPair * adg_dim_get_pos (AdgDim *dim);
89 void adg_dim_set_level (AdgDim *dim,
90 gdouble level);
91 gdouble adg_dim_get_level (AdgDim *dim);
92 void adg_dim_set_outside (AdgDim *dim,
93 AdgThreeState outside);
94 AdgThreeState adg_dim_get_outside (AdgDim *dim);
95 void adg_dim_set_detached (AdgDim *dim,
96 AdgThreeState detached);
97 AdgThreeState adg_dim_get_detached (AdgDim *dim);
98 void adg_dim_set_value (AdgDim *dim,
99 const gchar *value);
100 const gchar * adg_dim_get_value (AdgDim *dim);
101 void adg_dim_set_limits (AdgDim *dim,
102 const gchar *min,
103 const gchar *max);
104 void adg_dim_set_min (AdgDim *dim,
105 const gchar *min);
106 const gchar * adg_dim_get_min (AdgDim *dim);
107 void adg_dim_set_max (AdgDim *dim,
108 const gchar *max);
109 const gchar * adg_dim_get_max (AdgDim *dim);
110 gdouble adg_dim_quote_angle (AdgDim *dim,
111 gdouble angle);
112 AdgAlignment * adg_dim_get_quote (AdgDim *dim);
114 G_END_DECLS
117 #endif /* __ADG_DIM_H__ */