Commit 949b6e3f authored by Sven Neumann's avatar Sven Neumann
Browse files

changed GIMP_MIN_RESOLUTION to 5e-3,

a bunch of small cleanups here and there


--Sven
parent 53edc0db
2000-04-06 Sven Neumann <sven@gimp.org>
* libgimp/gimplimits.h: changed GIMP_MIN_RESOLUTION to 5e-3 so
it does not display as 0.000 in the UI. The new limit still allows
you to have pixels as large as 25 m^2. Should be enough IMO...
Changed GIMP_CHECK_DARK and GIMP_CHECK_LIGHT to match the default
check colors (GRAY_CHECKS) as defined in app/image_render.[ch].
* app/free_select.c: fixed warnings
* app/fileops.c: made an end to the "incidentally gimage already
has a valid preview" message
* app/gimpimageP.h
* app/gimpimage.c: use gboolean for boolean values
2000-04-06 Michael Natterer <mitch@gimp.org>
 
* app/commands.c
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -848,13 +848,14 @@ file_save_thumbnail (GimpImage *gimage,
return FALSE;
}
if (gimp_image_preview_valid (gimage, GRAY_CHANNEL))
{
/* just for debugging */
g_print ("(incidentally, gimage already has a valid preview - %dx%d)\n",
gimage->comp_preview->width,
gimage->comp_preview->height);
}
/* just for debugging
* if (gimp_image_preview_valid (gimage, GRAY_CHANNEL))
* {
* g_print ("(incidentally, gimage already has a valid preview - %dx%d)\n",
* gimage->comp_preview->width,
* gimage->comp_preview->height);
* }
*/
pathname = g_dirname (full_source_filename);
filename = g_basename (full_source_filename); /* Don't free! */
......
......@@ -172,6 +172,8 @@ free_select_button_press (Tool *tool,
case SELECTION_MOVE:
init_edit_selection (tool, gdisp_ptr, bevent, MaskToLayerTranslate);
return;
default:
/* fallthrough */
}
add_point (0, bevent->x, bevent->y);
......
......@@ -3799,18 +3799,18 @@ gimp_image_composite_preview (GimpImage *gimage,
}
}
gint
gboolean
gimp_image_preview_valid (GimpImage *gimage,
ChannelType type)
{
switch (type)
{
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case RED_CHANNEL: return gimage->comp_preview_valid[RED_PIX]; break;
case GREEN_CHANNEL: return gimage->comp_preview_valid[GREEN_PIX]; break;
case BLUE_CHANNEL: return gimage->comp_preview_valid[BLUE_PIX]; break;
case GRAY_CHANNEL: return gimage->comp_preview_valid[GRAY_PIX]; break;
case INDEXED_CHANNEL: return gimage->comp_preview_valid[INDEXED_PIX]; break;
default: return TRUE;
default: return TRUE;
}
}
......
......@@ -47,7 +47,7 @@ struct _GimpImage
GimpImageBaseType base_type; /* base gimp_image type */
guchar *cmap; /* colormap--for indexed */
int num_cols; /* number of cols--for indexed */
gint num_cols; /* number of cols--for indexed */
gint dirty; /* dirty flag -- # of ops */
gboolean undo_on; /* Is undo enabled? */
......@@ -104,7 +104,7 @@ struct _GimpImage
/* Composite preview */
TempBuf *comp_preview; /* the composite preview */
gint comp_preview_valid[3]; /* preview valid-1/channel */
gboolean comp_preview_valid[3]; /* preview valid-1/channel */
};
struct _GimpImageClass
......
......@@ -172,6 +172,8 @@ free_select_button_press (Tool *tool,
case SELECTION_MOVE:
init_edit_selection (tool, gdisp_ptr, bevent, MaskToLayerTranslate);
return;
default:
/* fallthrough */
}
add_point (0, bevent->x, bevent->y);
......
......@@ -172,6 +172,8 @@ free_select_button_press (Tool *tool,
case SELECTION_MOVE:
init_edit_selection (tool, gdisp_ptr, bevent, MaskToLayerTranslate);
return;
default:
/* fallthrough */
}
add_point (0, bevent->x, bevent->y);
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball
*
* gimplimits.h
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
......@@ -7,11 +7,11 @@
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
......@@ -25,11 +25,11 @@
/* pixel sizes
*/
#define GIMP_MIN_IMAGE_SIZE 1
#define GIMP_MAX_IMAGE_SIZE 16777216
#define GIMP_MAX_IMAGE_SIZE 16777216 /* 2^24 */
/* dots per inch
*/
#define GIMP_MIN_RESOLUTION (1.0 / 65536.0)
#define GIMP_MIN_RESOLUTION 5e-3 /* shouldn't display as 0.000 */
#define GIMP_MAX_RESOLUTION 65536.0
/* the size of the checks which indicate transparency...
......@@ -39,7 +39,7 @@
/* ...and their colors
*/
#define GIMP_CHECK_DARK (1.0 / 3.0)
#define GIMP_CHECK_LIGHT (2.0 / 3.0)
#define GIMP_CHECK_DARK 0.4 /* corresponds to GRAY_CHECKS as */
#define GIMP_CHECK_LIGHT 0.6 /* defined in app/image_render.c */
#endif /* __GIMP_LIMITS_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball
*
* gimplimits.h
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
......@@ -7,11 +7,11 @@
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
......@@ -25,11 +25,11 @@
/* pixel sizes
*/
#define GIMP_MIN_IMAGE_SIZE 1
#define GIMP_MAX_IMAGE_SIZE 16777216
#define GIMP_MAX_IMAGE_SIZE 16777216 /* 2^24 */
/* dots per inch
*/
#define GIMP_MIN_RESOLUTION (1.0 / 65536.0)
#define GIMP_MIN_RESOLUTION 5e-3 /* shouldn't display as 0.000 */
#define GIMP_MAX_RESOLUTION 65536.0
/* the size of the checks which indicate transparency...
......@@ -39,7 +39,7 @@
/* ...and their colors
*/
#define GIMP_CHECK_DARK (1.0 / 3.0)
#define GIMP_CHECK_LIGHT (2.0 / 3.0)
#define GIMP_CHECK_DARK 0.4 /* corresponds to GRAY_CHECKS as */
#define GIMP_CHECK_LIGHT 0.6 /* defined in app/image_render.c */
#endif /* __GIMP_LIMITS_H__ */
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