Commit af237c22 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

return GIMP_UNIT_MM in case that we can't query the locale.

2007-11-12  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-utils.c (gimp_get_default_unit): return
	GIMP_UNIT_MM in case that we can't query the locale.

	* plug-ins/common/postscript.c: use gboolean for boolean 
variables.


svn path=/trunk/; revision=24139
parent f44a8ea7
2007-11-12 Sven Neumann <sven@gimp.org>
* app/core/gimp-utils.c (gimp_get_default_unit): return
GIMP_UNIT_MM in case that we can't query the locale.
* plug-ins/common/postscript.c: use gboolean for boolean variables.
2007-11-12 Sven Neumann <sven@gimp.org> 2007-11-12 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-merge.c (gimp_image_merge_layers): corrected * app/core/gimpimage-merge.c (gimp_image_merge_layers): corrected
......
...@@ -373,7 +373,7 @@ gimp_get_default_unit (void) ...@@ -373,7 +373,7 @@ gimp_get_default_unit (void)
} }
#endif #endif
return GIMP_UNIT_INCH; return GIMP_UNIT_MM;
} }
GParameter * GParameter *
......
...@@ -132,7 +132,7 @@ typedef struct ...@@ -132,7 +132,7 @@ typedef struct
{ {
guint resolution; /* resolution (dpi) at which to run ghostscript */ guint resolution; /* resolution (dpi) at which to run ghostscript */
guint width, height; /* desired size (ghostscript may ignore this) */ guint width, height; /* desired size (ghostscript may ignore this) */
gint use_bbox; /* 0: use width/height, 1: try to use BoundingBox */ gboolean use_bbox; /* 0: use width/height, 1: try to use BoundingBox */
gchar pages[STR_LENGTH]; /* Pages to load (eg.: 1,3,5-7) */ gchar pages[STR_LENGTH]; /* Pages to load (eg.: 1,3,5-7) */
gint pnm_type; /* 4: pbm, 5: pgm, 6: ppm, 7: automatic */ gint pnm_type; /* 4: pbm, 5: pgm, 6: ppm, 7: automatic */
gint textalpha; /* antialiasing: 1,2, or 4 TextAlphaBits */ gint textalpha; /* antialiasing: 1,2, or 4 TextAlphaBits */
...@@ -143,7 +143,7 @@ static PSLoadVals plvals = ...@@ -143,7 +143,7 @@ static PSLoadVals plvals =
{ {
100, /* 100 dpi */ 100, /* 100 dpi */
826, 1170, /* default width/height (A4) */ 826, 1170, /* default width/height (A4) */
1, /* try to use BoundingBox */ TRUE, /* try to use BoundingBox */
"1", /* pages to load */ "1", /* pages to load */
6, /* use ppm (colour) */ 6, /* use ppm (colour) */
1, /* dont use text antialiasing */ 1, /* dont use text antialiasing */
...@@ -162,12 +162,12 @@ typedef struct ...@@ -162,12 +162,12 @@ typedef struct
{ {
gdouble width, height; /* Size of image */ gdouble width, height; /* Size of image */
gdouble x_offset, y_offset; /* Offset to image on page */ gdouble x_offset, y_offset; /* Offset to image on page */
gint unit_mm; /* Unit of measure (0: inch, 1: mm) */ gboolean unit_mm; /* Unit of measure (0: inch, 1: mm) */
gint keep_ratio; /* Keep aspect ratio */ gboolean keep_ratio; /* Keep aspect ratio */
gint rotate; /* Rotation (0, 90, 180, 270) */ gint rotate; /* Rotation (0, 90, 180, 270) */
gint level; /* PostScript Level */ gint level; /* PostScript Level */
gint eps; /* Encapsulated PostScript flag */ gboolean eps; /* Encapsulated PostScript flag */
gint preview; /* Preview Flag */ gboolean preview; /* Preview Flag */
gint preview_size; /* Preview size */ gint preview_size; /* Preview size */
} PSSaveVals; } PSSaveVals;
...@@ -175,12 +175,12 @@ static PSSaveVals psvals = ...@@ -175,12 +175,12 @@ static PSSaveVals psvals =
{ {
287.0, 200.0, /* Image size (A4) */ 287.0, 200.0, /* Image size (A4) */
5.0, 5.0, /* Offset */ 5.0, 5.0, /* Offset */
1, /* Unit is mm */ TRUE, /* Unit is mm */
1, /* Keep edge ratio */ TRUE, /* Keep edge ratio */
0, /* Rotate */ 0, /* Rotate */
2, /* PostScript Level */ 2, /* PostScript Level */
0, /* Encapsulated PostScript flag */ FALSE, /* Encapsulated PostScript flag */
0, /* Preview flag */ FALSE, /* Preview flag */
256 /* Preview size */ 256 /* Preview size */
}; };
...@@ -733,6 +733,7 @@ ps_set_save_size (PSSaveVals *vals, ...@@ -733,6 +733,7 @@ ps_set_save_size (PSSaveVals *vals,
unit = gimp_image_get_unit (image_ID); unit = gimp_image_get_unit (image_ID);
factor = gimp_unit_get_factor (unit); factor = gimp_unit_get_factor (unit);
if (factor == 0.0254 || if (factor == 0.0254 ||
factor == 0.254 || factor == 0.254 ||
factor == 2.54 || factor == 2.54 ||
...@@ -746,6 +747,7 @@ ps_set_save_size (PSSaveVals *vals, ...@@ -746,6 +747,7 @@ ps_set_save_size (PSSaveVals *vals,
iw *= 25.4; iw *= 25.4;
ih *= 25.4; ih *= 25.4;
} }
vals->width = iw; vals->width = iw;
vals->height = ih; vals->height = ih;
} }
...@@ -786,7 +788,7 @@ run (const gchar *name, ...@@ -786,7 +788,7 @@ run (const gchar *name,
gimp_get_data (LOAD_PS_PROC, &plvals); gimp_get_data (LOAD_PS_PROC, &plvals);
if (! load_dialog (param[1].data.d_string, if (! load_dialog (param[1].data.d_string,
! strcmp (name, LOAD_PDF_PROC))) strcmp (name, LOAD_PDF_PROC) == 0))
status = GIMP_PDB_CANCEL; status = GIMP_PDB_CANCEL;
break; break;
...@@ -920,7 +922,7 @@ run (const gchar *name, ...@@ -920,7 +922,7 @@ run (const gchar *name,
psvals.unit_mm = (param[9].data.d_int32 != 0); psvals.unit_mm = (param[9].data.d_int32 != 0);
psvals.keep_ratio = (param[10].data.d_int32 != 0); psvals.keep_ratio = (param[10].data.d_int32 != 0);
psvals.rotate = param[11].data.d_int32; psvals.rotate = param[11].data.d_int32;
psvals.eps = param[12].data.d_int32; psvals.eps = (param[12].data.d_int32 != 0);
psvals.preview = (param[13].data.d_int32 != 0); psvals.preview = (param[13].data.d_int32 != 0);
psvals.preview_size = param[13].data.d_int32; psvals.preview_size = param[13].data.d_int32;
psvals.level = param[14].data.d_int32; psvals.level = param[14].data.d_int32;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment