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

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 *);
......
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