Commit dcfb450b authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

app/[all files with resolution info] libgimp/gimp.h libgimp/gimpimage.c

1999-05-22  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/[all files with resolution info]
	* libgimp/gimp.h
	* libgimp/gimpimage.c
	* libgimp/gimpsizeentry.[ch]
	* libgimp/gimpunit.[ch]
	* plug-ins/newsprint/newsprint.c
	* plug-ins/pgn/png.c
	* plug-ins/tiff/tiff.c: double instead of float for all resolution
	and unit-factor variables.

	* app/commands.c
	* app/crop.c
	* app/interface.c
	* app/layers_dialog.c
	* app/move_tool.c
	* app/resize.c
	* app/rotate_tool.c
	* app/scale_tool.c: pass the image's unit *and* gdisp->dot_for_dot
	to all functions which create sizeentries. Never create a
	sizeentry with UNIT_PIXEL but with the image's unit and set it's
	unit to UNIT_PIXEL after creation if dot_for_dot is on.
	This way the image's unit can always be picked from the menu
	without selecting "More...".

	* app/interface.c: made the query_*_box() functions use the
	ActionArea.

	* plug-ins/gimpunitmenu.c: GTK_WIN_POS_MOUSE for the unit
	selection dialog.
parent c79272ac
1999-05-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/[all files with resolution info]
* libgimp/gimp.h
* libgimp/gimpimage.c
* libgimp/gimpsizeentry.[ch]
* libgimp/gimpunit.[ch]
* plug-ins/newsprint/newsprint.c
* plug-ins/pgn/png.c
* plug-ins/tiff/tiff.c: double instead of float for all resolution
and unit-factor variables.
* app/commands.c
* app/crop.c
* app/interface.c
* app/layers_dialog.c
* app/move_tool.c
* app/resize.c
* app/rotate_tool.c
* app/scale_tool.c: pass the image's unit *and* gdisp->dot_for_dot
to all functions which create sizeentries. Never create a
sizeentry with UNIT_PIXEL but with the image's unit and set it's
unit to UNIT_PIXEL after creation if dot_for_dot is on.
This way the image's unit can always be picked from the menu
without selecting "More...".
* app/interface.c: made the query_*_box() functions use the
ActionArea.
* plug-ins/gimpunitmenu.c: GTK_WIN_POS_MOUSE for the unit
selection dialog.
Fri May 21 10:39:00 CST 1999 Seth Burgess <sjburges@gimp.org>
* app/gimprc.c
* app/gimprc.h
* app/gimprc_cmds.c : wrapped up value_to_str and added it to
......
......@@ -365,9 +365,10 @@ select_border_cmd_callback (GtkWidget *widget,
query_size_box (_("Border Selection"), _("Border selection by:"),
selection_border_radius, 1, 32767, 0,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_border_callback, gdisp->gimage);
}
......@@ -382,9 +383,10 @@ select_feather_cmd_callback (GtkWidget *widget,
query_size_box (_("Feather Selection"), _("Feather selection by:"),
selection_feather_radius, 0, 32767, 3,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_feather_callback, gdisp->gimage);
}
......@@ -399,9 +401,10 @@ select_grow_cmd_callback (GtkWidget *widget,
query_size_box (_("Grow Selection"), _("Grow selection by:"),
selection_grow_pixels, 1, 32767, 0,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_grow_callback, gdisp->gimage);
}
......@@ -416,9 +419,10 @@ select_shrink_cmd_callback (GtkWidget *widget,
query_size_box (_("Shrink Selection"), _("Shrink selection by:"),
selection_shrink_pixels, 1, 32767, 0,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_shrink_callback, gdisp->gimage);
}
......@@ -1211,7 +1215,7 @@ gimage_mask_feather_callback (GtkWidget *w,
double radius_x;
double radius_y;
selection_feather_radius = *(float*) call_data;
selection_feather_radius = *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......@@ -1245,7 +1249,7 @@ gimage_mask_border_callback (GtkWidget *w,
double radius_x;
double radius_y;
selection_border_radius = (int) *(float*) call_data;
selection_border_radius = (int) *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......@@ -1279,7 +1283,7 @@ gimage_mask_grow_callback (GtkWidget *w,
double radius_x;
double radius_y;
selection_grow_pixels = (int) *(float*) call_data;
selection_grow_pixels = (int) *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......@@ -1313,7 +1317,7 @@ gimage_mask_shrink_callback (GtkWidget *w,
int radius_x;
int radius_y;
selection_shrink_pixels = (int) *(float*) call_data;
selection_shrink_pixels = (int) *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......
......@@ -87,6 +87,7 @@
#include "color_select.h"
#include "gimpparasite.h"
#include "libgimp/gimplimits.h"
#include "libgimp/gimpintl.h"
#define LOGO_WIDTH_MIN 300
......@@ -497,13 +498,10 @@ app_init (void)
restore_session = TRUE;
/* make sure the monitor resolution is valid */
if (monitor_xres < 1e-5 || monitor_yres < 1e-5)
if (monitor_xres < GIMP_MIN_RESOLUTION ||
monitor_yres < GIMP_MIN_RESOLUTION)
{
gfloat xres, yres;
gdisplay_xserver_resolution (&xres, &yres);
monitor_xres = xres;
monitor_yres = yres;
gdisplay_xserver_resolution (&monitor_xres, &monitor_yres);
using_xserver_resolution = TRUE;
}
......
......@@ -643,7 +643,7 @@ blend_motion (Tool *tool,
}
else /* show real world units */
{
float unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
g_snprintf (vector, STATUSBAR_SIZE, gdisp->cursor_format_str,
_("Blend: "),
......
......@@ -365,9 +365,10 @@ select_border_cmd_callback (GtkWidget *widget,
query_size_box (_("Border Selection"), _("Border selection by:"),
selection_border_radius, 1, 32767, 0,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_border_callback, gdisp->gimage);
}
......@@ -382,9 +383,10 @@ select_feather_cmd_callback (GtkWidget *widget,
query_size_box (_("Feather Selection"), _("Feather selection by:"),
selection_feather_radius, 0, 32767, 3,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_feather_callback, gdisp->gimage);
}
......@@ -399,9 +401,10 @@ select_grow_cmd_callback (GtkWidget *widget,
query_size_box (_("Grow Selection"), _("Grow selection by:"),
selection_grow_pixels, 1, 32767, 0,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_grow_callback, gdisp->gimage);
}
......@@ -416,9 +419,10 @@ select_shrink_cmd_callback (GtkWidget *widget,
query_size_box (_("Shrink Selection"), _("Shrink selection by:"),
selection_shrink_pixels, 1, 32767, 0,
gdisp->dot_for_dot ? UNIT_PIXEL : gdisp->gimage->unit,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
gdisp->dot_for_dot,
GTK_OBJECT (gdisp->gimage), "destroy",
gimage_mask_shrink_callback, gdisp->gimage);
}
......@@ -1211,7 +1215,7 @@ gimage_mask_feather_callback (GtkWidget *w,
double radius_x;
double radius_y;
selection_feather_radius = *(float*) call_data;
selection_feather_radius = *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......@@ -1245,7 +1249,7 @@ gimage_mask_border_callback (GtkWidget *w,
double radius_x;
double radius_y;
selection_border_radius = (int) *(float*) call_data;
selection_border_radius = (int) *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......@@ -1279,7 +1283,7 @@ gimage_mask_grow_callback (GtkWidget *w,
double radius_x;
double radius_y;
selection_grow_pixels = (int) *(float*) call_data;
selection_grow_pixels = (int) *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......@@ -1313,7 +1317,7 @@ gimage_mask_shrink_callback (GtkWidget *w,
int radius_x;
int radius_y;
selection_shrink_pixels = (int) *(float*) call_data;
selection_shrink_pixels = (int) *(double*) call_data;
g_free (call_data);
unit = (GUnit) gtk_object_get_data (GTK_OBJECT (w), "size_query_unit");
......
......@@ -643,7 +643,7 @@ blend_motion (Tool *tool,
}
else /* show real world units */
{
float unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
g_snprintf (vector, STATUSBAR_SIZE, gdisp->cursor_format_str,
_("Blend: "),
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -319,8 +319,8 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
void
gimp_image_set_resolution (GimpImage *gimage,
float xresolution,
float yresolution)
double xresolution,
double yresolution)
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
......@@ -328,8 +328,8 @@ gimp_image_set_resolution (GimpImage *gimage,
void
gimp_image_get_resolution (GimpImage *gimage,
float *xresolution,
float *yresolution)
double *xresolution,
double *yresolution)
{
g_return_if_fail(xresolution && yresolution);
*xresolution = gimage->xresolution;
......
......@@ -108,10 +108,11 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float, float);
void gimp_image_set_resolution (GimpImage *,
double, double);
void gimp_image_get_resolution (GimpImage *,
float *,
float *);
double *,
double *);
void gimp_image_set_unit (GimpImage *, GUnit);
GUnit gimp_image_get_unit (GimpImage *);
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
......
......@@ -1024,14 +1024,14 @@ gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
}
else /* show real world units */
{
float unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
g_snprintf (buffer, CURSOR_STR_LENGTH,
gdisp->cursor_format_str,
"",
(float)t_x * unit_factor / gdisp->gimage->xresolution,
", ",
(float)t_y * unit_factor / gdisp->gimage->yresolution);
double unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
g_snprintf
(buffer, CURSOR_STR_LENGTH, gdisp->cursor_format_str,
"",
(double) t_x * unit_factor / gdisp->gimage->xresolution,
", ",
(double) t_y * unit_factor / gdisp->gimage->yresolution);
}
gtk_label_set (GTK_LABEL (gdisp->cursor_label), buffer);
}
......@@ -1076,7 +1076,7 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
}
else /* show real world units */
{
float unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
g_snprintf (gdisp->cursor_format_str, sizeof(gdisp->cursor_format_str),
"%%s%%.%df%%s%%.%df %s",
......@@ -1086,14 +1086,14 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
g_snprintf (buffer, sizeof(buffer), gdisp->cursor_format_str,
"",
(float)gdisp->gimage->width * unit_factor /
(gdouble) gdisp->gimage->width * unit_factor /
gdisp->gimage->xresolution,
", ",
(float)gdisp->gimage->height * unit_factor /
(gdouble) gdisp->gimage->height * unit_factor /
gdisp->gimage->yresolution);
}
cursor_label_width =
gdk_string_width ( gtk_widget_get_style(gdisp->cursor_label)->font, buffer );
gdk_string_width (gtk_widget_get_style (gdisp->cursor_label)->font, buffer);
/* find out how many pixels the label's parent frame is bigger than
* the label itself */
......
......@@ -35,11 +35,11 @@
#define SCALESRC(g) (g->scale & 0x00ff)
#define SCALEDEST(g) (g->scale >> 8)
/* finding the effective screen resolution (float) */
/* finding the effective screen resolution (double) */
#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : monitor_xres)
#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : monitor_yres)
/* calculate scale factors (float) */
/* calculate scale factors (double) */
#define SCALEFACTOR_X(g) ((SCALEDEST(g) * SCREEN_XRES(g)) / \
(SCALESRC(g) * g->gimage->xresolution))
#define SCALEFACTOR_Y(g) ((SCALEDEST(g) * SCREEN_YRES(g)) / \
......
......@@ -40,7 +40,7 @@
typedef struct {
guint delete_on_exit;
float factor;
gdouble factor;
gint digits;
gchar *identifier;
gchar *symbol;
......@@ -100,13 +100,13 @@ gimp_unit_get_number_of_built_in_units (void)
GUnit
gimp_unit_new (gchar *identifier,
gfloat factor,
gint digits,
gchar *symbol,
gchar *abbreviation,
gchar *singular,
gchar *plural)
gimp_unit_new (gchar *identifier,
gdouble factor,
gint digits,
gchar *symbol,
gchar *abbreviation,
gchar *singular,
gchar *plural)
{
GimpUnitDef *user_unit;
......@@ -151,7 +151,7 @@ gimp_unit_set_deletion_flag (GUnit unit,
}
gfloat
gdouble
gimp_unit_get_factor (GUnit unit)
{
g_return_val_if_fail ( (unit >= UNIT_PIXEL) &&
......
......@@ -502,14 +502,14 @@ crop_motion (Tool *tool,
}
else /* show real world units */
{
float unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
gdouble unit_factor = gimp_unit_get_factor (gdisp->gimage->unit);
g_snprintf (size, STATUSBAR_SIZE, gdisp->cursor_format_str,
_("Crop: "),
(float)(crop->tx2 - crop->tx1) * unit_factor /
(gdouble) (crop->tx2 - crop->tx1) * unit_factor /
gdisp->gimage->xresolution,
" x ",
(float)(crop->ty2 - crop->ty1) * unit_factor /
(gdouble) (crop->ty2 - crop->ty1) * unit_factor /
gdisp->gimage->yresolution);
}
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), crop->context_id,
......
......@@ -295,8 +295,9 @@ file_new_confirm_dialog (NewImageValues *vals)
vals->confirm_dlg = gtk_dialog_new ();
gtk_window_set_wmclass (GTK_WINDOW (vals->confirm_dlg),
"really_create", "Gimp");
"confirm_size", "Gimp");
gtk_window_set_title (GTK_WINDOW (vals->confirm_dlg), _("Confirm Image Size"));
gtk_window_set_policy (GTK_WINDOW (vals->confirm_dlg), FALSE, FALSE, FALSE);
gtk_window_position (GTK_WINDOW (vals->confirm_dlg), GTK_WIN_POS_MOUSE);
/* Handle the wm close signal */
......@@ -480,7 +481,6 @@ file_new_cmd_callback (GtkWidget *widget,
N_("RGB"),
N_("Grayscale")
};
static gchar *fill_type_names[] =
{
N_("Foreground"),
......
......@@ -200,7 +200,7 @@ info_window_update (InfoDialog *info_win,
GDisplay *gdisp;
InfoWinData *iwd;
int type;
gfloat unit_factor;
gdouble unit_factor;
gint unit_digits;
gchar format_buf[32];
......
......@@ -33,6 +33,7 @@
#include "libgimp/gimpfileselection.h"
#include "libgimp/gimppatheditor.h"
#include "libgimp/gimpsizeentry.h"
#include "libgimp/gimplimits.h"
#include "libgimp/gimpintl.h"
/* preferences local functions */
......@@ -245,7 +246,8 @@ file_prefs_ok_callback (GtkWidget *widget,
default_units = old_default_units;
return;
}
if (default_xresolution < 1e-5 || default_yresolution < 1e-5)
if (default_xresolution < GIMP_MIN_RESOLUTION ||
default_yresolution < GIMP_MIN_RESOLUTION)
{
g_message (_("Error: default resolution must not be zero."));
default_xresolution = old_default_xresolution;
......@@ -259,7 +261,8 @@ file_prefs_ok_callback (GtkWidget *widget,
default_resolution_units = old_default_resolution_units;
return;
}
if (monitor_xres < 1e-5 || monitor_yres < 1e-5)
if (monitor_xres < GIMP_MIN_RESOLUTION ||
monitor_yres < GIMP_MIN_RESOLUTION)
{
g_message (_("Error: Monitor resolution must not be zero."));
monitor_xres = old_monitor_xres;
......@@ -388,9 +391,9 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "default-image-size");
if (default_units != old_default_units)