mirror of https://github.com/GNOME/gimp.git
renamed struct member "unit" to "resolution_unit".
2004-10-12 Sven Neumann <sven@gimp.org> * app/core/gimpimage.[ch]: renamed struct member "unit" to "resolution_unit". * app/actions/image-commands.c * app/core/gimp-edit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-undo-push.c * app/dialogs/info-window.c * app/vectors/gimpvectors-export.c * app/widgets/gimptoolbox-dnd.c: * app/xcf/xcf-load.c * app/xcf/xcf-save.c: changed accordingly. Use gimp_image_get_unit() where appropriate. * app/core/gimptemplate.c (gimp_template_set_from_image): fixed unit handling. Don't touch the template unit, it is used as the initial display unit. This will need further changes...
This commit is contained in:
parent
fcc342b00b
commit
ab6c609ce1
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2004-10-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimpimage.[ch]: renamed struct member "unit" to
|
||||
"resolution_unit".
|
||||
|
||||
* app/actions/image-commands.c
|
||||
* app/core/gimp-edit.c
|
||||
* app/core/gimpimage-duplicate.c
|
||||
* app/core/gimpimage-undo-push.c
|
||||
* app/dialogs/info-window.c
|
||||
* app/vectors/gimpvectors-export.c
|
||||
* app/widgets/gimptoolbox-dnd.c:
|
||||
* app/xcf/xcf-load.c
|
||||
* app/xcf/xcf-save.c: changed accordingly. Use gimp_image_get_unit()
|
||||
where appropriate.
|
||||
|
||||
* app/core/gimptemplate.c (gimp_template_set_from_image): fixed
|
||||
unit handling. Don't touch the template unit, it is used as the
|
||||
initial display unit. This will need further changes...
|
||||
|
||||
2004-10-12 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpwidgets-utils.c (gimp_enum_radio_frame_add):
|
||||
|
|
|
@ -614,10 +614,10 @@ image_scale_implement (ImageResizeOptions *options)
|
|||
{
|
||||
GimpImage *gimage = options->gimage;
|
||||
|
||||
if (options->dialog->resolution_x == gimage->xresolution &&
|
||||
options->dialog->resolution_y == gimage->yresolution &&
|
||||
options->dialog->unit == gimage->unit &&
|
||||
options->dialog->width == gimage->width &&
|
||||
if (options->dialog->resolution_x == gimage->xresolution &&
|
||||
options->dialog->resolution_y == gimage->yresolution &&
|
||||
options->dialog->unit == gimage->resolution_unit &&
|
||||
options->dialog->width == gimage->width &&
|
||||
options->dialog->height == gimage->height)
|
||||
return;
|
||||
|
||||
|
|
|
@ -241,7 +241,8 @@ gimp_edit_paste_as_new (Gimp *gimp,
|
|||
{
|
||||
gimp_image_set_resolution (gimage,
|
||||
invoke->xresolution, invoke->yresolution);
|
||||
gimp_image_set_unit (gimage, invoke->unit);
|
||||
gimp_image_set_unit (gimage,
|
||||
gimp_image_get_unit (invoke));
|
||||
}
|
||||
|
||||
layer = gimp_layer_new_from_tiles (paste->tiles,
|
||||
|
|
|
@ -74,10 +74,10 @@ gimp_image_duplicate (GimpImage *gimage)
|
|||
gimp_image_get_colormap_size (gimage),
|
||||
FALSE);
|
||||
|
||||
/* Copy resolution and unit information */
|
||||
new_gimage->xresolution = gimage->xresolution;
|
||||
new_gimage->yresolution = gimage->yresolution;
|
||||
new_gimage->unit = gimage->unit;
|
||||
/* Copy resolution information */
|
||||
new_gimage->xresolution = gimage->xresolution;
|
||||
new_gimage->yresolution = gimage->yresolution;
|
||||
new_gimage->resolution_unit = gimage->resolution_unit;
|
||||
|
||||
/* Copy floating layer */
|
||||
floating_layer = gimp_image_floating_sel (gimage);
|
||||
|
|
|
@ -221,9 +221,9 @@ typedef struct _ResolutionUndo ResolutionUndo;
|
|||
|
||||
struct _ResolutionUndo
|
||||
{
|
||||
gdouble xres;
|
||||
gdouble yres;
|
||||
GimpUnit unit;
|
||||
gdouble xres;
|
||||
gdouble yres;
|
||||
GimpUnit unit;
|
||||
};
|
||||
|
||||
static gboolean undo_pop_image_resolution (GimpUndo *undo,
|
||||
|
@ -253,7 +253,7 @@ gimp_image_undo_push_image_resolution (GimpImage *gimage,
|
|||
|
||||
ru->xres = gimage->xresolution;
|
||||
ru->yres = gimage->yresolution;
|
||||
ru->unit = gimage->unit;
|
||||
ru->unit = gimage->resolution_unit;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -286,12 +286,12 @@ undo_pop_image_resolution (GimpUndo *undo,
|
|||
accum->resolution_changed = TRUE;
|
||||
}
|
||||
|
||||
if (ru->unit != undo->gimage->unit)
|
||||
if (ru->unit != undo->gimage->resolution_unit)
|
||||
{
|
||||
GimpUnit unit;
|
||||
|
||||
unit = undo->gimage->unit;
|
||||
undo->gimage->unit = ru->unit;
|
||||
unit = undo->gimage->resolution_unit;
|
||||
undo->gimage->resolution_unit = ru->unit;
|
||||
ru->unit = unit;
|
||||
|
||||
accum->unit_changed = TRUE;
|
||||
|
|
|
@ -511,7 +511,7 @@ gimp_image_init (GimpImage *gimage)
|
|||
gimage->height = 0;
|
||||
gimage->xresolution = 1.0;
|
||||
gimage->yresolution = 1.0;
|
||||
gimage->unit = GIMP_UNIT_INCH;
|
||||
gimage->resolution_unit = GIMP_UNIT_INCH;
|
||||
gimage->base_type = GIMP_RGB;
|
||||
|
||||
gimage->cmap = NULL;
|
||||
|
@ -637,9 +637,9 @@ gimp_image_constructor (GType type,
|
|||
GINT_TO_POINTER (gimage->ID),
|
||||
gimage);
|
||||
|
||||
gimage->xresolution = config->default_image->xresolution;
|
||||
gimage->yresolution = config->default_image->yresolution;
|
||||
gimage->unit = config->default_image->resolution_unit;
|
||||
gimage->xresolution = config->default_image->xresolution;
|
||||
gimage->yresolution = config->default_image->yresolution;
|
||||
gimage->resolution_unit = config->default_image->resolution_unit;
|
||||
|
||||
gimage->grid = gimp_config_duplicate (GIMP_CONFIG (config->default_grid));
|
||||
|
||||
|
@ -1391,12 +1391,12 @@ gimp_image_set_unit (GimpImage *gimage,
|
|||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
g_return_if_fail (unit > GIMP_UNIT_PIXEL);
|
||||
|
||||
if (gimage->unit != unit)
|
||||
if (gimage->resolution_unit != unit)
|
||||
{
|
||||
gimp_image_undo_push_image_resolution (gimage,
|
||||
_("Change Image Unit"));
|
||||
|
||||
gimage->unit = unit;
|
||||
gimage->resolution_unit = unit;
|
||||
gimp_image_unit_changed (gimage);
|
||||
}
|
||||
}
|
||||
|
@ -1406,7 +1406,7 @@ gimp_image_get_unit (const GimpImage *gimage)
|
|||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_UNIT_INCH);
|
||||
|
||||
return gimage->unit;
|
||||
return gimage->resolution_unit;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -108,7 +108,7 @@ struct _GimpImage
|
|||
gint width, height; /* width and height attributes */
|
||||
gdouble xresolution; /* image x-res, in dpi */
|
||||
gdouble yresolution; /* image y-res, in dpi */
|
||||
GimpUnit unit; /* resolution unit */
|
||||
GimpUnit resolution_unit; /* resolution unit */
|
||||
GimpImageBaseType base_type; /* base gimp_image type */
|
||||
|
||||
guchar *cmap; /* colormap--for indexed */
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "config/gimpconfig.h"
|
||||
#include "config/gimpconfig-params.h"
|
||||
#include "config/gimpcoreconfig.h"
|
||||
|
||||
#include "gimp.h"
|
||||
#include "gimpcontext.h"
|
||||
|
@ -383,10 +382,9 @@ gimp_template_set_from_image (GimpTemplate *template,
|
|||
g_object_set (template,
|
||||
"width", gimp_image_get_width (gimage),
|
||||
"height", gimp_image_get_height (gimage),
|
||||
"unit", gimp_image_get_unit (gimage),
|
||||
"xresolution", xresolution,
|
||||
"yresolution", yresolution,
|
||||
"resolution-unit", gimage->gimp->config->default_image->resolution_unit,
|
||||
"resolution-unit", gimp_image_get_unit (gimage),
|
||||
"image-type", image_type,
|
||||
"comment", comment,
|
||||
NULL);
|
||||
|
|
|
@ -426,7 +426,7 @@ info_window_update_cursor (GimpDisplay *gdisp,
|
|||
gchar buf[32];
|
||||
|
||||
if (unit == GIMP_UNIT_PIXEL)
|
||||
unit = image->unit;
|
||||
unit = gimp_image_get_unit (image);
|
||||
|
||||
unit_factor = _gimp_unit_get_factor (image->gimp, unit);
|
||||
unit_digits = _gimp_unit_get_digits (image->gimp, unit);
|
||||
|
@ -544,7 +544,7 @@ info_window_update (GimpDisplay *gdisp)
|
|||
unit = GIMP_DISPLAY_SHELL (gdisp->shell)->unit;
|
||||
|
||||
if (unit == GIMP_UNIT_PIXEL)
|
||||
unit = image->unit;
|
||||
unit = gimp_image_get_unit (image);
|
||||
|
||||
unit_factor = _gimp_unit_get_factor (image->gimp, unit);
|
||||
unit_digits = _gimp_unit_get_digits (image->gimp, unit);
|
||||
|
@ -557,7 +557,7 @@ info_window_update (GimpDisplay *gdisp)
|
|||
image->height * unit_factor / image->yresolution);
|
||||
|
||||
/* resolution */
|
||||
unit = image->unit;
|
||||
unit = gimp_image_get_unit (image);
|
||||
unit_factor = _gimp_unit_get_factor (image->gimp, unit);
|
||||
|
||||
g_snprintf (format_buf, sizeof (format_buf), _("pixels/%s"),
|
||||
|
|
|
@ -172,7 +172,7 @@ gimp_vectors_export_image_size (const GimpImage *image,
|
|||
h = (gdouble) image->height / image->yresolution;
|
||||
|
||||
/* FIXME: should probably use the display unit here */
|
||||
unit = image->unit;
|
||||
unit = gimp_image_get_unit (image);
|
||||
switch (unit)
|
||||
{
|
||||
case GIMP_UNIT_INCH: abbrev = "in"; break;
|
||||
|
|
|
@ -166,7 +166,8 @@ gimp_toolbox_drop_drawable (GtkWidget *widget,
|
|||
|
||||
gimp_image_set_resolution (new_image,
|
||||
gimage->xresolution, gimage->yresolution);
|
||||
gimp_image_set_unit (new_image, gimage->unit);
|
||||
gimp_image_set_unit (new_image,
|
||||
gimp_image_get_unit (gimage));
|
||||
|
||||
if (GIMP_IS_LAYER (drawable))
|
||||
new_type = G_TYPE_FROM_INSTANCE (drawable);
|
||||
|
|
|
@ -434,7 +434,7 @@ xcf_load_image_props (XcfInfo *info,
|
|||
unit = GIMP_UNIT_INCH;
|
||||
}
|
||||
|
||||
gimage->unit = unit;
|
||||
gimage->resolution_unit = unit;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -488,7 +488,7 @@ xcf_load_image_props (XcfInfo *info,
|
|||
unit_strings[3],
|
||||
unit_strings[4]);
|
||||
|
||||
gimage->unit = unit;
|
||||
gimage->resolution_unit = unit;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
g_free (unit_strings[i]);
|
||||
|
|
|
@ -414,6 +414,7 @@ xcf_save_image_props (XcfInfo *info,
|
|||
GError **error)
|
||||
{
|
||||
GimpParasite *parasite = NULL;
|
||||
GimpUnit unit = gimp_image_get_unit (gimage);
|
||||
|
||||
/* check and see if we should save the colormap property */
|
||||
if (gimage->cmap)
|
||||
|
@ -438,9 +439,8 @@ xcf_save_image_props (XcfInfo *info,
|
|||
xcf_check_error (xcf_save_prop (info, gimage, PROP_PARASITES,
|
||||
error, gimage->parasites));
|
||||
|
||||
if (gimage->unit < _gimp_unit_get_number_of_built_in_units (gimage->gimp))
|
||||
xcf_check_error (xcf_save_prop (info, gimage, PROP_UNIT,
|
||||
error, gimage->unit));
|
||||
if (unit < _gimp_unit_get_number_of_built_in_units (gimage->gimp))
|
||||
xcf_check_error (xcf_save_prop (info, gimage, PROP_UNIT, error, unit));
|
||||
|
||||
if (gimp_container_num_children (gimage->vectors) > 0)
|
||||
{
|
||||
|
@ -450,9 +450,8 @@ xcf_save_image_props (XcfInfo *info,
|
|||
xcf_check_error (xcf_save_prop (info, gimage, PROP_VECTORS, error));
|
||||
}
|
||||
|
||||
if (gimage->unit >= _gimp_unit_get_number_of_built_in_units (gimage->gimp))
|
||||
xcf_check_error (xcf_save_prop (info, gimage, PROP_USER_UNIT,
|
||||
error, gimage->unit));
|
||||
if (unit >= _gimp_unit_get_number_of_built_in_units (gimage->gimp))
|
||||
xcf_check_error (xcf_save_prop (info, gimage, PROP_USER_UNIT, error, unit));
|
||||
|
||||
if (GIMP_IS_GRID (gimage->grid))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue