3 * Copyright (C) 2001-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * gLabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>.
23 #include "units-util.h"
28 /*========================================================*/
29 /* Private macros and constants. */
30 /*========================================================*/
33 /*========================================================*/
35 /*========================================================*/
38 /*========================================================*/
39 /* Private globals. */
40 /*========================================================*/
43 /*========================================================*/
44 /* Private function prototypes. */
45 /*========================================================*/
48 /****************************************************************************/
49 /* Get step size for desired units. */
50 /****************************************************************************/
52 gl_units_util_get_step_size (lglUnits units)
57 return 0.1; /* points */
59 return 0.001; /* inches */
63 g_message ("Illegal units"); /* Should not happen */
69 /****************************************************************************/
70 /* Get precision for desired units. */
71 /****************************************************************************/
73 gl_units_util_get_precision (lglUnits units)
78 return 1; /* points */
80 return 3; /* inches */
84 g_message ("Illegal units"); /* Should not happen */
90 /****************************************************************************/
91 /* Get grid size for desired units. */
92 /****************************************************************************/
94 gl_units_util_get_grid_size (lglUnits units)
101 return 0.125 * lgl_units_get_points_per_unit (units);
103 return 5 * lgl_units_get_points_per_unit (units);
105 g_message ("Illegal units"); /* Should not happen */
114 * Local Variables: -- emacs
116 * c-basic-offset: 8 -- emacs
117 * tab-width: 8 -- emacs
118 * indent-tabs-mode: nil -- emacs