dia r3877 - trunk/lib



Author: lclausen
Date: Thu Jan 17 17:26:11 2008
New Revision: 3877
URL: http://svn.gnome.org/viewvc/dia?rev=3877&view=rev

Log:
Moved units array.


Modified:
   trunk/lib/diatypes.h
   trunk/lib/geometry.c
   trunk/lib/geometry.h
   trunk/lib/widgets.c

Modified: trunk/lib/diatypes.h
==============================================================================
--- trunk/lib/diatypes.h	(original)
+++ trunk/lib/diatypes.h	Thu Jan 17 17:26:11 2008
@@ -97,6 +97,7 @@
 typedef struct _DiaFontClass DiaFontClass;
 
 /* In geometry.h: */
+typedef struct _DiaUnitDef            DiaUnitDef;
 typedef struct _Point Point;
 typedef struct _Rectangle Rectangle;
 typedef struct _IntRectangle IntRectangle;
@@ -186,5 +187,4 @@
 typedef struct _DiaFileSelector       DiaFileSelector;
 typedef struct _DiaFileSelectorClass  DiaFileSelectorClass;
 
-
 #endif

Modified: trunk/lib/geometry.c
==============================================================================
--- trunk/lib/geometry.c	(original)
+++ trunk/lib/geometry.c	Thu Jan 17 17:26:11 2008
@@ -30,6 +30,24 @@
 #include "geometry.h"
 #include "object.h"
 
+
+/* from gnome-libs/libgnome/gnome-paper.c */
+const DiaUnitDef units[] =
+{
+  /* XXX does anyone *really* measure paper size in feet?  meters? */
+
+  /* human name, abreviation, points per unit */
+  { "Centimeter", "cm", 28.346457, 2 },
+  { "Decimeter",  "dm", 283.46457, 3 },
+  { "Feet",       "ft", 864, 4 },
+  { "Inch",       "in", 72, 3 },
+  { "Meter",      "m",  2834.6457, 4 },
+  { "Millimeter", "mm", 2.8346457, 2 },
+  { "Point",      "pt", 1, 2 },
+  { "Pica",       "pi", 12, 2 },
+  { 0 }
+};
+
 void
 rectangle_union(Rectangle *r1, const Rectangle *r2)
 {

Modified: trunk/lib/geometry.h
==============================================================================
--- trunk/lib/geometry.h	(original)
+++ trunk/lib/geometry.h	Thu Jan 17 17:26:11 2008
@@ -66,6 +66,17 @@
 
 G_BEGIN_DECLS
 
+/** Definitions of miscellaneous units.  Note that all sizes used
+ * internally are in cm, units should only be used for display purposes.
+ */
+struct _DiaUnitDef {
+  char* name;
+  char* unit;
+  float factor;
+  int digits; /** Number of digits after the decimal separator */
+};
+extern const DiaUnitDef units[];
+
 /*
   Coordinate system used:
    +---> x

Modified: trunk/lib/widgets.c
==============================================================================
--- trunk/lib/widgets.c	(original)
+++ trunk/lib/widgets.c	Thu Jan 17 17:26:11 2008
@@ -1540,31 +1540,6 @@
  *  limits, and b) avoid rounding problems while editing.
  */
 
-typedef struct _DiaUnitDef DiaUnitDef;
-struct _DiaUnitDef {
-  char* name;
-  char* unit;
-  float factor;
-  int digits; /** Number of digits after the decimal separator */
-};
-
-/* from gnome-libs/libgnome/gnome-paper.c */
-static const DiaUnitDef units[] =
-{
-  /* XXX does anyone *really* measure paper size in feet?  meters? */
-
-  /* human name, abreviation, points per unit */
-  { "Centimeter", "cm", 28.346457, 2 },
-  { "Decimeter",  "dm", 283.46457, 3 },
-  { "Feet",       "ft", 864, 4 },
-  { "Inch",       "in", 72, 3 },
-  { "Meter",      "m",  2834.6457, 4 },
-  { "Millimeter", "mm", 2.8346457, 2 },
-  { "Point",      "pt", 1, 2 },
-  { "Pica",       "pi", 12, 2 },
-  { 0 }
-};
-
 static void dia_unit_spinner_init(DiaUnitSpinner *self);
 
 GType



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]