Commit 69250d2d authored by Ari Pollak's avatar Ari Pollak

Imported Upstream version 2.4.1

parent 258b1471
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -54,12 +54,15 @@ EXTRA_DIST = \
ChangeLog.pre-1-0 \
ChangeLog.pre-1-2 \
ChangeLog.pre-2-0 \
ChangeLog.pre-2-2 \
ChangeLog.pre-2-4 \
HACKING \
INSTALL \
LICENSE \
NEWS \
NEWS.pre-2-0 \
NEWS.pre-2-2 \
NEWS.pre-2-4 \
README \
README.i18n \
README.win32 \
......
......@@ -510,12 +510,15 @@ EXTRA_DIST = \
ChangeLog.pre-1-0 \
ChangeLog.pre-1-2 \
ChangeLog.pre-2-0 \
ChangeLog.pre-2-2 \
ChangeLog.pre-2-4 \
HACKING \
INSTALL \
LICENSE \
NEWS \
NEWS.pre-2-0 \
NEWS.pre-2-2 \
NEWS.pre-2-4 \
README \
README.i18n \
README.win32 \
......
------------------------------
GNU Image Manipulation Program
2.4 Stable Branch
------------------------------
This is the stable branch of GIMP.
This is the stable branch of GIMP. No new features are being added
here, just bug-fixes.
Changes in GIMP 2.4.1
=====================
- fixed a minor display rendering problem
- improved the workaround for broken graphics card drivers (bug #421466)
- fixed a crash with broken scripts and plug-ins (bug #490055)
- fixed potential syntax error in configure script (bug #490068)
- fixed parsing of floating point numbers in Script-Fu (bug #490198)
- fixed potential crash when converting an indexed image to RGB (bug #490048)
- update the histogram while doing color corrections (bug #490182)
- fixed another crash with broken plug-ins (bug #490617)
- fixed problems on Win32 when GIMP is installed into a non-ASCII path
- fixed handling of truncated ASCII PNM files (bug #490827)
- make sure that there's always a cursor, even for small brushes (bug #491272)
- fixed line-drawing with a tablet and the Shift key (bug #164240)
- added code to use the system monitor profile on OS X (bug #488170)
- show changes to the rounded corners in the Rectangle Select tool (bug #418284)
- reduced rounding errors in the display render routines (bug #490785)
- translation updates (ca, de, et, lt, mk, pa, sv)
This diff is collapsed.
......@@ -41,6 +41,7 @@ OBJECTS = \
tile-manager-crop.obj \
tile-manager-preview.obj \
tile-pyramid.obj \
tile-rowhints.obj \
tile-swap.obj \
INCLUDES = \
......
......@@ -452,7 +452,7 @@ tile_pyramid_write_quarter (Tile *dest,
src1[0] * src1[1] +
src2[0] * src2[1] +
src3[0] * src3[1]) / a);
dst[1] = a >> 2;
dst[1] = (a + 2) >> 2;
break;
}
......@@ -512,7 +512,7 @@ tile_pyramid_write_quarter (Tile *dest,
src1[2] * src1[3] +
src2[2] * src2[3] +
src3[2] * src3[3]) / a);
dst[3] = a >> 2;
dst[3] = (a + 2) >> 2;
break;
}
......
......@@ -33,6 +33,7 @@
#include "gimpimagemap.h"
#include "gimpmarshal.h"
#include "gimppickable.h"
#include "gimpviewable.h"
enum
......@@ -63,6 +64,7 @@ struct _GimpImageMap
static void gimp_image_map_pickable_iface_init (GimpPickableInterface *iface);
static void gimp_image_map_dispose (GObject *object);
static void gimp_image_map_finalize (GObject *object);
static GimpImage * gimp_image_map_get_image (GimpPickable *pickable);
......@@ -100,6 +102,7 @@ gimp_image_map_class_init (GimpImageMapClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->dispose = gimp_image_map_dispose;
object_class->finalize = gimp_image_map_finalize;
}
......@@ -127,6 +130,17 @@ gimp_image_map_init (GimpImageMap *image_map)
image_map->idle_id = 0;
}
static void
gimp_image_map_dispose (GObject *object)
{
GimpImageMap *image_map = GIMP_IMAGE_MAP (object);
if (image_map->drawable)
gimp_viewable_preview_thaw (GIMP_VIEWABLE (image_map->drawable));
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_image_map_finalize (GObject *object)
{
......@@ -153,6 +167,12 @@ gimp_image_map_finalize (GObject *object)
image_map->PRI = NULL;
}
if (image_map->drawable)
{
g_object_unref (image_map->drawable);
image_map->drawable = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......@@ -243,9 +263,11 @@ gimp_image_map_new (GimpDrawable *drawable,
image_map = g_object_new (GIMP_TYPE_IMAGE_MAP, NULL);
image_map->drawable = drawable;
image_map->drawable = g_object_ref (drawable);
image_map->undo_desc = g_strdup (undo_desc);
gimp_viewable_preview_freeze (GIMP_VIEWABLE (drawable));
return image_map;
}
......@@ -474,7 +496,6 @@ static gboolean
gimp_image_map_do (GimpImageMap *image_map)
{
GimpImage *image;
gint off_x, off_y;
gint i;
if (! gimp_item_is_attached (GIMP_ITEM (image_map->drawable)))
......@@ -486,8 +507,6 @@ gimp_image_map_do (GimpImageMap *image_map)
image = gimp_item_get_image (GIMP_ITEM (image_map->drawable));
gimp_item_offsets (GIMP_ITEM (image_map->drawable), &off_x, &off_y);
/* Process up to 16 tiles in one go. This reduces the overhead
* caused by updating the display while the imagemap is being
* applied and gives us a tiny speedup.
......@@ -525,11 +544,7 @@ gimp_image_map_do (GimpImageMap *image_map)
NULL,
x, y);
/* Update the image -- It is important to call gimp_image_update()
* instead of gimp_drawable_update() because we don't want the
* drawable preview to be constantly invalidated
*/
gimp_image_update (image, x + off_x, y + off_y, w, h);
gimp_drawable_update (image_map->drawable, x, y, w, h);
image_map->PRI = pixel_regions_process (image_map->PRI);
......
......@@ -163,7 +163,8 @@ gimp_viewable_class_init (GimpViewableClass *klass)
static void
gimp_viewable_init (GimpViewable *viewable)
{
viewable->stock_id = NULL;
viewable->stock_id = NULL;
viewable->freeze_count = 0;
}
static void
......@@ -398,7 +399,8 @@ gimp_viewable_invalidate_preview (GimpViewable *viewable)
{
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
g_signal_emit (viewable, viewable_signals[INVALIDATE_PREVIEW], 0);
if (viewable->freeze_count == 0)
g_signal_emit (viewable, viewable_signals[INVALIDATE_PREVIEW], 0);
}
/**
......@@ -1042,3 +1044,23 @@ gimp_viewable_set_stock_id (GimpViewable *viewable,
g_object_notify (G_OBJECT (viewable), "stock-id");
}
void
gimp_viewable_preview_freeze (GimpViewable *viewable)
{
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
viewable->freeze_count++;
}
void
gimp_viewable_preview_thaw (GimpViewable *viewable)
{
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
g_return_if_fail (viewable->freeze_count > 0);
viewable->freeze_count--;
if (viewable->freeze_count == 0)
gimp_viewable_invalidate_preview (viewable);
}
......@@ -52,6 +52,7 @@ struct _GimpViewable
/*< private >*/
gchar *stock_id;
gint freeze_count;
};
struct _GimpViewableClass
......@@ -169,5 +170,8 @@ const gchar * gimp_viewable_get_stock_id (GimpViewable *viewable);
void gimp_viewable_set_stock_id (GimpViewable *viewable,
const gchar *stock_id);
void gimp_viewable_preview_freeze (GimpViewable *viewable);
void gimp_viewable_preview_thaw (GimpViewable *viewable);
#endif /* __GIMP_VIEWABLE_H__ */
......@@ -446,11 +446,11 @@ prefs_resolution_source_callback (GtkWidget *widget,
{
GimpSizeEntry *entry = g_object_get_data (G_OBJECT (widget),
"monitor_resolution_sizeentry");
if (entry)
{
xres = gimp_size_entry_get_refval (entry, 0);
yres = gimp_size_entry_get_refval (entry, 1);
}
g_return_if_fail (GIMP_IS_SIZE_ENTRY (entry));
xres = gimp_size_entry_get_refval (entry, 0);
yres = gimp_size_entry_get_refval (entry, 1);
}
g_object_set (config,
......
......@@ -262,6 +262,23 @@ gimp_canvas_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
}
/* Returns: %TRUE if the XOR color is not white */
static gboolean
gimp_canvas_get_xor_color (GimpCanvas *canvas,
GdkColor *color)
{
GimpDisplayConfig *config = GIMP_DISPLAY_CONFIG (canvas->gimp->config);
guchar r, g, b;
gimp_rgb_get_uchar (&config->xor_color, &r, &g, &b);
color->red = (r << 8) | r;
color->green = (g << 8) | g;
color->blue = (b << 8) | b;
return (r != 255 || g != 255 || b != 255);
}
static GdkGC *
gimp_canvas_gc_new (GimpCanvas *canvas,
GimpCanvasStyle style)
......@@ -269,8 +286,8 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
GdkGC *gc;
GdkGCValues values;
GdkGCValuesMask mask = 0;
GdkColor fg;
GdkColor bg;
GdkColor fg = { 0, 0, 0, 0 };
GdkColor bg = { 0, 0, 0, 0 };
if (! GTK_WIDGET_REALIZED (canvas))
return NULL;
......@@ -296,7 +313,12 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
case GIMP_CANVAS_STYLE_XOR:
mask |= GDK_GC_FUNCTION | GDK_GC_CAP_STYLE | GDK_GC_JOIN_STYLE;
values.function = GDK_XOR;
if (gimp_canvas_get_xor_color (canvas, &fg))
values.function = GDK_XOR;
else
values.function = GDK_INVERT;
values.cap_style = GDK_CAP_NOT_LAST;
values.join_style = GDK_JOIN_MITER;
break;
......@@ -325,10 +347,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
gdk_gc_set_dashes (gc, 0, &one, 1);
}
bg.red = 0x0;
bg.green = 0x0;
bg.blue = 0x0;
switch (style)
{
default:
......@@ -337,16 +355,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
case GIMP_CANVAS_STYLE_XOR_DOTTED:
case GIMP_CANVAS_STYLE_XOR_DASHED:
case GIMP_CANVAS_STYLE_XOR:
{
GimpDisplayConfig *config = GIMP_DISPLAY_CONFIG (canvas->gimp->config);
guchar r, g, b;
gimp_rgb_get_uchar (&config->xor_color, &r, &g, &b);
fg.red = (r << 8) | r;
fg.green = (g << 8) | g;
fg.blue = (b << 8) | b;
}
break;
case GIMP_CANVAS_STYLE_WHITE:
......
......@@ -256,8 +256,6 @@ gimp_display_shell_render (GimpDisplayShell *shell,
info.alpha = render_image_init_alpha (opacity * 255.999);
}
/* Setup RenderInfo for rendering a GimpProjection level. */
{
TileManager *src_tiles;
......@@ -272,17 +270,9 @@ gimp_display_shell_render (GimpDisplayShell *shell,
gimp_display_shell_render_info_scale (&info, shell, src_tiles, level);
}
/* Currently, only RGBA and GRAYA projection types are used - the rest
* are in case of future need. -- austin, 28th Nov 1998.
*
* I retired them before they reach the age of 9 years unused...
* -- simon, 23rd Sep 2007.
*/
/* Currently, only RGBA and GRAYA projection types are used. */
type = gimp_projection_get_image_type (projection);
if (G_UNLIKELY (type != GIMP_RGBA_IMAGE && type != GIMP_GRAYA_IMAGE))
g_warning ("using untested projection type %d", type);
switch (type)
{
case GIMP_RGBA_IMAGE:
......@@ -292,7 +282,7 @@ gimp_display_shell_render (GimpDisplayShell *shell,
render_image_gray_a (&info);
break;
default:
g_printerr ("gimp_display_shell_render: unsupported projection type\n");
g_warning ("%s: unsupported projection type (%d)", G_STRFUNC, type);
g_assert_not_reached ();
}
......@@ -686,7 +676,7 @@ box_filter (const guint left_weight,
const gint bpp)
{
const guint sum = ((left_weight + center_weight + right_weight) *
(top_weight + middle_weight + bottom_weight)) >> 8;
(top_weight + middle_weight + bottom_weight)) >> 4;
switch (bpp)
{
......@@ -695,15 +685,15 @@ box_filter (const guint left_weight,
{
guint factors[9] =
{
(src[1][ALPHA] * top_weight) >> 8,
(src[4][ALPHA] * middle_weight) >> 8,
(src[7][ALPHA] * bottom_weight) >> 8,
(src[2][ALPHA] * top_weight) >> 8,
(src[5][ALPHA] * middle_weight) >> 8,
(src[8][ALPHA] * bottom_weight) >> 8,
(src[0][ALPHA] * top_weight) >> 8,
(src[3][ALPHA] * middle_weight) >> 8,
(src[6][ALPHA] * bottom_weight) >> 8
(src[1][ALPHA] * top_weight) >> 4,
(src[4][ALPHA] * middle_weight) >> 4,
(src[7][ALPHA] * bottom_weight) >> 4,
(src[2][ALPHA] * top_weight) >> 4,
(src[5][ALPHA] * middle_weight) >> 4,
(src[8][ALPHA] * bottom_weight) >> 4,
(src[0][ALPHA] * top_weight) >> 4,
(src[3][ALPHA] * middle_weight) >> 4,
(src[6][ALPHA] * bottom_weight) >> 4
};
guint a = (center_weight * (factors[0] + factors[1] + factors[2]) +
......@@ -730,7 +720,7 @@ box_filter (const guint left_weight,
) / a) & 0xff;
}
dest[ALPHA] = a / sum;
dest[ALPHA] = (a + (sum >> 1)) / sum;
}
else
{
......@@ -749,15 +739,15 @@ box_filter (const guint left_weight,
{
guint factors[9] =
{
(src[1][ALPHA] * top_weight) >> 8,
(src[4][ALPHA] * middle_weight) >> 8,
(src[7][ALPHA] * bottom_weight) >> 8,
(src[2][ALPHA] * top_weight) >> 8,
(src[5][ALPHA] * middle_weight) >> 8,
(src[8][ALPHA] * bottom_weight) >> 8,
(src[0][ALPHA] * top_weight) >> 8,
(src[3][ALPHA] * middle_weight) >> 8,
(src[6][ALPHA] * bottom_weight) >> 8
(src[1][ALPHA] * top_weight) >> 4,
(src[4][ALPHA] * middle_weight) >> 4,
(src[7][ALPHA] * bottom_weight) >> 4,
(src[2][ALPHA] * top_weight) >> 4,
(src[5][ALPHA] * middle_weight) >> 4,
(src[8][ALPHA] * bottom_weight) >> 4,
(src[0][ALPHA] * top_weight) >> 4,
(src[3][ALPHA] * middle_weight) >> 4,
(src[6][ALPHA] * bottom_weight) >> 4
};
guint a = (center_weight * (factors[0] + factors[1] + factors[2]) +
......@@ -784,7 +774,7 @@ box_filter (const guint left_weight,
) / a) & 0xff;
}
dest[ALPHA] = a / sum;
dest[ALPHA] = (a + (sum >> 1)) / sum;
}
else
{
......
......@@ -26,8 +26,8 @@
/* Apply to a float the same rounding mode used in the renderer */
#define PROJ_ROUND(coord) ((gint) (coord))
#define PROJ_ROUND64(coord) ((gint64) (coord))
#define PROJ_ROUND(coord) ((gint) ((coord) + 0.5))
#define PROJ_ROUND64(coord) ((gint64) ((coord) + 0.5))
/* finding the effective screen resolution (double) */
#define SCREEN_XRES(s) ((s)->dot_for_dot ? \
......
......@@ -13,8 +13,6 @@ OBJECTS = \
file-procedure.obj \
file-save.obj \
file-utils.obj \
gimprecentitem.obj \
gimprecentlist.obj \
INCLUDES = \
-FImsvc_recommended_pragmas.h \
......
......@@ -45,7 +45,8 @@ INCLUDES = \
-I$(includedir)
DEFINES = \
-DG_LOG_DOMAIN=\"Gimp-GUI\"
-DG_LOG_DOMAIN=\"Gimp-GUI\" \
-DGIMP_COMMAND=\"gimp.exe\"
all : \
$(PRJ_TOP)\config.h \
......
......@@ -169,7 +169,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
area->bytes);
}
if (pressure_options->opacity)
if (paint_core->use_pressure && pressure_options->opacity)
opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure;
/* finally, let the brush core paste the colored area on the canvas */
......
......@@ -407,6 +407,8 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
return_vals = gimp_procedure_get_return_values (procedure, FALSE);
g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
va_end (va_args);
return return_vals;
}
......@@ -422,6 +424,8 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
return_vals = gimp_procedure_get_return_values (procedure, FALSE);
g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
va_end (va_args);
return return_vals;
}
}
......
......@@ -607,6 +607,11 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
}
else
{
const gchar *value = g_value_get_string (&string_value);
if (value == NULL)
value = "(null)";
if (return_vals)
{
gimp_message (gimp, G_OBJECT (progress),
......@@ -616,7 +621,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
"(#%d, type %s). "
"This value is out of range."),
gimp_object_get_name (GIMP_OBJECT (procedure)),
g_value_get_string (&string_value),
value,
g_param_spec_get_name (pspec),
i + 1, g_type_name (spec_type));
}
......@@ -629,7 +634,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
"(#%d, type %s). "
"This value is out of range."),
gimp_object_get_name (GIMP_OBJECT (procedure)),
g_value_get_string (&string_value),
value,
g_param_spec_get_name (pspec),
i + 1, g_type_name (spec_type));
}
......
......@@ -617,8 +617,6 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
proc->mtime = time (NULL);
proc->installed_during_init = (plug_in->call_mode == GIMP_PLUG_IN_CALL_INIT);
gimp_plug_in_procedure_set_image_types (proc, proc_install->image_types);
gimp_object_take_name (GIMP_OBJECT (procedure), canonical);
gimp_procedure_set_strings (procedure,
proc_install->name,
......@@ -629,6 +627,8 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
proc_install->date,
NULL);
gimp_plug_in_procedure_set_image_types (proc, proc_install->image_types);
for (i = 0; i < proc_install->nparams; i++)
{
GParamSpec *pspec =
......
......@@ -44,6 +44,7 @@ OBJECTS = \
\
plug-in-enums.obj \
plug-in-icc-profile.obj \
plug-in-menu-path.obj \
plug-in-params.obj \
plug-in-rc.obj
......
......@@ -118,7 +118,7 @@ gimp_text_class_init (GimpTextClass *klass)
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_FONT_SIZE,
"font-size", NULL,
0.0, 8192.0, 18.0,
0.0, 8192.0, 24.0,
GIMP_PARAM_STATIC_STRINGS);
/*
* We use the name "font-size-unit" for backward compatibility.
......
......@@ -35,6 +35,7 @@
#include "paint/gimppaintoptions.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "gimpbrushtool.h"
#include "gimptoolcontrol.h"
......@@ -259,26 +260,28 @@ gimp_brush_tool_draw (GimpDrawTool *draw_tool)
return;
gimp_brush_tool_draw_brush (brush_tool,
brush_tool->brush_x, brush_tool->brush_y);
brush_tool->brush_x, brush_tool->brush_y,
! brush_tool->show_cursor);
}
void
gimp_brush_tool_draw_brush (GimpBrushTool *brush_tool,
gdouble x,
gdouble y)
gdouble y,
gboolean draw_fallback)
{
GimpDrawTool *draw_tool;
GimpBrushCore *brush_core;
GimpPaintOptions *paint_options;
GimpPaintOptions *options;
g_return_if_fail (GIMP_IS_BRUSH_TOOL (brush_tool));
if (! brush_tool->draw_brush)
return;
draw_tool = GIMP_DRAW_TOOL (brush_tool);
brush_core = GIMP_BRUSH_CORE (GIMP_PAINT_TOOL (brush_tool)->core);
paint_options = GIMP_PAINT_TOOL_GET_OPTIONS (brush_tool);
draw_tool = GIMP_DRAW_TOOL (brush_tool);