Image
*image;
- register long
+ register ssize_t
i;
- unsigned long
+ size_t
state;
XrmDatabase
state=DefaultState;
for (i=0; (state & ExitState) == 0; i++)
{
- if ((images->iterations != 0) && (i >= (long) images->iterations))
+ if ((images->iterations != 0) && (i >= (ssize_t) images->iterations))
break;
image=GetImageFromList(images,i % GetImageListLength(images));
(void) XDisplayImage(display,&resource_info,argv,1,&image,&state);
%
*/
-static inline long MagickMax(const long x,const long y)
+static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
{
if (x > y)
return(x);
return(y);
}
-static inline long MagickMin(const long x,const long y)
+static inline ssize_t MagickMin(const ssize_t x,const ssize_t y)
{
if (x < y)
return(x);
register char
*p;
- register long
+ register ssize_t
i;
unsigned int
height,
width;
- unsigned long
+ size_t
state;
XAnnotateInfo
/*
Annotate Image window with primary selection.
*/
- for (i=0; i < (long) length; i++)
+ for (i=0; i < (ssize_t) length; i++)
{
if ((char) data[i] != '\n')
{
*/
windows->pixel_info->box_color=windows->pixel_info->pen_colors[box_id];
if (windows->pixel_info->colors != 0)
- for (i=0; i < (long) windows->pixel_info->colors; i++)
+ for (i=0; i < (ssize_t) windows->pixel_info->colors; i++)
if (windows->pixel_info->pixels[i] ==
windows->pixel_info->pen_colors[box_id].pixel)
{
}
windows->pixel_info->pen_color=windows->pixel_info->pen_colors[pen_id];
if (windows->pixel_info->colors != 0)
- for (i=0; i < (long) windows->pixel_info->colors; i++)
+ for (i=0; i < (ssize_t) windows->pixel_info->colors; i++)
if (windows->pixel_info->pixels[i] ==
windows->pixel_info->pen_colors[pen_id].pixel)
{
height,
width;
- unsigned long
+ size_t
state;
XEvent
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- chop_info.width,chop_info.height,chop_info.x,chop_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) chop_info.width,(double)
+ chop_info.height,(double) chop_info.x,(double) chop_info.y);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
windows->image.highlight_context,&segment_info);
*/
if (direction == HorizontalChopCommand)
{
- chop_info.width=(unsigned long) (segment_info.x2-segment_info.x1+1);
+ chop_info.width=(size_t) (segment_info.x2-segment_info.x1+1);
chop_info.x=windows->image.x+segment_info.x1;
chop_info.height=0;
chop_info.y=0;
if (segment_info.x1 > (int) segment_info.x2)
{
- chop_info.width=(unsigned long) (segment_info.x1-segment_info.x2+1);
+ chop_info.width=(size_t) (segment_info.x1-segment_info.x2+1);
chop_info.x=windows->image.x+segment_info.x2;
}
}
else
{
chop_info.width=0;
- chop_info.height=(unsigned long) (segment_info.y2-segment_info.y1+1);
+ chop_info.height=(size_t) (segment_info.y2-segment_info.y1+1);
chop_info.x=0;
chop_info.y=windows->image.y+segment_info.y1;
if (segment_info.y1 > segment_info.y2)
{
- chop_info.height=(unsigned long)
+ chop_info.height=(size_t)
(segment_info.y1-segment_info.y2+1);
chop_info.y=windows->image.y+segment_info.y2;
}
register PixelPacket
*q;
- register long
+ register ssize_t
i;
unsigned int
height,
width;
- unsigned long
+ size_t
state;
XColor
break;
if (entry != 5)
{
- (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0*QuantumRange+
- 1.0);
+ (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0*
+ QuantumRange+1.0);
break;
}
(void) (void) CopyMagickString(fuzz,"20%",MaxTextExtent);
(height*(windows->image.y+y_offset)/windows->image.ximage->height+y);
if ((x_offset < 0) || (y_offset < 0))
continue;
- if ((x_offset >= (long) (*image)->columns) ||
- (y_offset >= (long) (*image)->rows))
+ if ((x_offset >= (ssize_t) (*image)->columns) ||
+ (y_offset >= (ssize_t) (*image)->rows))
continue;
exception=(&(*image)->exception);
switch (method)
&(*image)->exception);
if ((*image)->storage_class == DirectClass)
{
- for (y=0; y < (long) (*image)->rows; y++)
+ for (y=0; y < (ssize_t) (*image)->rows; y++)
{
q=GetAuthenticPixels(*image,0,y,(*image)->columns,1,
exception);
*/
if (SetImageStorageClass(*image,DirectClass) == MagickFalse)
return(MagickFalse);
- for (y=0; y < (long) (*image)->rows; y++)
+ for (y=0; y < (ssize_t) (*image)->rows; y++)
{
q=QueueAuthenticPixels(*image,0,y,(*image)->columns,1,exception);
if (q == (PixelPacket *) NULL)
height,
width;
- unsigned long
+ size_t
state;
XEvent
Display pointer position.
*/
(void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
- composite_info.x,composite_info.y);
+ (long) composite_info.x,(long) composite_info.y);
XInfoWidget(display,windows,text);
}
highlight_info=composite_info;
*/
(void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel);
opacity=(Quantum) (ScaleQuantumToChar((Quantum) QuantumRange)-
- ((long) ScaleQuantumToChar((Quantum) QuantumRange)*blend)/100);
+ ((ssize_t) ScaleQuantumToChar((Quantum) QuantumRange)*blend)/100);
if (SetImageStorageClass(image,DirectClass) == MagickFalse)
return(MagickFalse);
image->matte=MagickTrue;
exception=(&image->exception);
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (PixelPacket *) NULL)
char
geometry[MaxTextExtent];
- long
+ ssize_t
x,
y;
MagickStatusType
status;
- unsigned long
+ size_t
mask,
height,
width;
height=(unsigned int) windows->image.window_changes.height;
if (image->debug != MagickFalse)
(void) LogMagickEvent(X11Event,GetMagickModule(),
- "Configure Image: %dx%d=>%lux%lu",windows->image.ximage->width,
- windows->image.ximage->height,width,height);
+ "Configure Image: %dx%d=>%.20gx%.20g",windows->image.ximage->width,
+ windows->image.ximage->height,(double) width,(double) height);
if ((width*height) == 0)
return(MagickTrue);
x=0;
window_changes.height=(int) height;
if (window_changes.height > XDisplayHeight(display,windows->image.screen))
window_changes.height=XDisplayHeight(display,windows->image.screen);
- mask=(unsigned long) (CWWidth | CWHeight);
+ mask=(size_t) (CWWidth | CWHeight);
if (resource_info->backdrop)
{
mask|=CWX | CWY;
height,
width;
- unsigned long
+ size_t
state;
XEvent
Display pointer position.
*/
(void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
- crop_info.x,crop_info.y);
+ (long) crop_info.x,(long) crop_info.y);
XInfoWidget(display,windows,text);
}
/*
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- crop_info.width,crop_info.height,crop_info.x,crop_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+ crop_info.height,(double) crop_info.x,(double) crop_info.y);
XInfoWidget(display,windows,text);
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- crop_info.width,crop_info.height,crop_info.x,crop_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+ crop_info.height,(double) crop_info.x,(double) crop_info.y);
XInfoWidget(display,windows,text);
}
highlight_info=crop_info;
(y < (int) (crop_info.y+RoiDelta)) &&
(y > (int) (crop_info.y-RoiDelta)))
{
- crop_info.x=(long) (crop_info.x+crop_info.width);
- crop_info.y=(long) (crop_info.y+crop_info.height);
+ crop_info.x=(ssize_t) (crop_info.x+crop_info.width);
+ crop_info.y=(ssize_t) (crop_info.y+crop_info.height);
state|=UpdateConfigurationState;
break;
}
(y < (int) (crop_info.y+crop_info.height+RoiDelta)) &&
(y > (int) (crop_info.y+crop_info.height-RoiDelta)))
{
- crop_info.x=(long) (crop_info.x+crop_info.width);
+ crop_info.x=(ssize_t) (crop_info.x+crop_info.width);
state|=UpdateConfigurationState;
break;
}
(y < (int) (crop_info.y+RoiDelta)) &&
(y > (int) (crop_info.y-RoiDelta)))
{
- crop_info.y=(long) (crop_info.y+crop_info.height);
+ crop_info.y=(ssize_t) (crop_info.y+crop_info.height);
state|=UpdateConfigurationState;
break;
}
case XK_Home:
case XK_KP_Home:
{
- crop_info.x=(long) (windows->image.width/2L-crop_info.width/2L);
- crop_info.y=(long) (windows->image.height/2L-crop_info.height/2L);
+ crop_info.x=(ssize_t) (windows->image.width/2L-crop_info.width/2L);
+ crop_info.y=(ssize_t) (windows->image.height/2L-crop_info.height/2L);
break;
}
case XK_Left:
/*
Set primary selection.
*/
- (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
- crop_info.width,crop_info.height,crop_info.x,crop_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
+ crop_info.height,(double) crop_info.x,(double) crop_info.y);
request=(&(event.xselectionrequest));
(void) XChangeProperty(request->display,request->requestor,
request->property,request->target,8,PropModeReplace,
return(MagickFalse);
image->matte=MagickTrue;
exception=(&image->exception);
- for (y=0; y < (long) crop_info.height; y++)
+ for (y=0; y < (ssize_t) crop_info.height; y++)
{
q=GetAuthenticPixels(image,crop_info.x,y+crop_info.y,crop_info.width,1,
exception);
max_coordinates,
width;
- unsigned long
+ size_t
state;
Window
/*
Display info and draw drawing rectangle.
*/
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- rectangle_info.width,rectangle_info.height,rectangle_info.x,
- rectangle_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
+ (double) rectangle_info.height,(double) rectangle_info.x,
+ (double) rectangle_info.y);
XInfoWidget(display,windows,text);
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&rectangle_info);
/*
Display info and draw drawing rectangle.
*/
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- rectangle_info.width,rectangle_info.height,rectangle_info.x,
- rectangle_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
+ (double) rectangle_info.height,(double) rectangle_info.x,
+ (double) rectangle_info.y);
XInfoWidget(display,windows,text);
XHighlightEllipse(display,windows->image.id,
windows->image.highlight_context,&rectangle_info);
rectangle_info.x=0;
else
if (rectangle_info.x > (int) windows->image.width)
- rectangle_info.x=(long) windows->image.width;
+ rectangle_info.x=(ssize_t) windows->image.width;
if ((int) rectangle_info.x < x)
rectangle_info.width=(unsigned int) (x-rectangle_info.x);
else
rectangle_info.y=0;
else
if (rectangle_info.y > (int) windows->image.height)
- rectangle_info.y=(long) windows->image.height;
+ rectangle_info.y=(ssize_t) windows->image.height;
if ((int) rectangle_info.y < y)
rectangle_info.height=(unsigned int) (y-rectangle_info.y);
else
if (coordinate_info[i].y < rectangle_info.y)
rectangle_info.y=MagickMax(coordinate_info[i].y,0);
}
- rectangle_info.width=(unsigned long) (x-rectangle_info.x);
- rectangle_info.height=(unsigned long) (y-rectangle_info.y);
+ rectangle_info.width=(size_t) (x-rectangle_info.x);
+ rectangle_info.height=(size_t) (y-rectangle_info.y);
for (i=0; i < number_coordinates; i++)
{
coordinate_info[i].x-=rectangle_info.x;
}
draw_info.rectangle_info=rectangle_info;
if (draw_info.rectangle_info.x > (int) (line_width/2))
- draw_info.rectangle_info.x=(long) line_width/2;
+ draw_info.rectangle_info.x=(ssize_t) line_width/2;
if (draw_info.rectangle_info.y > (int) (line_width/2))
- draw_info.rectangle_info.y=(long) line_width/2;
+ draw_info.rectangle_info.y=(ssize_t) line_width/2;
draw_info.number_coordinates=(unsigned int) number_coordinates;
draw_info.coordinate_info=coordinate_info;
windows->pixel_info->pen_color=windows->pixel_info->pen_colors[pen_id];
Image
*previous_image;
- long
+ ssize_t
bytes;
- bytes=(long) ((*image)->columns*(*image)->rows*sizeof(PixelPacket));
+ bytes=(ssize_t) ((*image)->columns*(*image)->rows*sizeof(PixelPacket));
if (undo_image != (Image *) NULL)
{
/*
{
bytes+=previous_image->list->columns*previous_image->list->rows*
sizeof(PixelPacket);
- if (bytes <= (long) (resource_info->undo_cache << 20))
+ if (bytes <= (ssize_t) (resource_info->undo_cache << 20))
{
previous_image=GetPreviousImageInList(previous_image);
continue;
cache_image=DestroyImage(cache_image);
}
}
- if (bytes > (long) (resource_info->undo_cache << 20))
+ if (bytes > (ssize_t) (resource_info->undo_cache << 20))
break;
/*
Save image before transformations are applied.
cache_image=DestroyImage(cache_image);
break;
}
- cache_image->columns=(unsigned long) windows->image.ximage->width;
- cache_image->rows=(unsigned long) windows->image.ximage->height;
+ cache_image->columns=(size_t) windows->image.ximage->width;
+ cache_image->rows=(size_t) windows->image.ximage->height;
cache_image->geometry=windows->image.crop_geometry;
if (windows->image.crop_geometry != (char *) NULL)
{
*/
crop_info.x=0;
crop_info.y=0;
- crop_info.width=(unsigned long) windows->image.ximage->width;
- crop_info.height=(unsigned long) windows->image.ximage->height;
+ crop_info.width=(size_t) windows->image.ximage->width;
+ crop_info.height=(size_t) windows->image.ximage->height;
if ((key_symbol == XK_Up) || (key_symbol == XK_KP_Up))
{
if (resource_info->quantum >= (int) crop_info.height)
int
status;
- long
+ ssize_t
x,
y;
- unsigned long
+ size_t
height,
width;
/*
Resize image.
*/
- width=(unsigned long) windows->image.ximage->width;
- height=(unsigned long) windows->image.ximage->height;
+ width=(size_t) windows->image.ximage->width;
+ height=(size_t) windows->image.ximage->height;
x=0;
y=0;
- (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu+0+0",
- width,height);
+ (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g+0+0",
+ (double) width,(double) height);
status=XDialogWidget(display,windows,"Resize",
"Enter resize geometry (e.g. 640x480, 200%):",geometry);
if (*geometry == '\0')
/*
Query user for the fuzz factor.
*/
- (void) FormatMagickString(fuzz,MaxTextExtent,"%g%%",100.0*(*image)->fuzz/
- (QuantumRange+1.0));
+ (void) FormatMagickString(fuzz,MaxTextExtent,"%g%%",100.0*
+ (*image)->fuzz/(QuantumRange+1.0));
(void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz);
if (*fuzz == '\0')
break;
if ((flags & PsiValue) == 0)
geometry_info.psi=0.1*(*image)->rows;
vignette_image=VignetteImage(*image,geometry_info.rho,geometry_info.sigma,
- (long) (geometry_info.xi+0.5),(long) (geometry_info.psi+0.5),
- &(*image)->exception);
+ (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-
+ 0.5),&(*image)->exception);
if (vignette_image != (Image *) NULL)
{
*image=DestroyImage(*image);
frame_info.height=page_geometry.height;
frame_info.outer_bevel=page_geometry.x;
frame_info.inner_bevel=page_geometry.y;
- frame_info.x=(long) frame_info.width;
- frame_info.y=(long) frame_info.height;
+ frame_info.x=(ssize_t) frame_info.width;
+ frame_info.y=(ssize_t) frame_info.height;
frame_info.width=(*image)->columns+2*frame_info.width;
frame_info.height=(*image)->rows+2*frame_info.height;
frame_image=FrameImage(*image,&frame_info,&(*image)->exception);
XCheckRefreshWindows(display,windows);
image_info->preview_type=(PreviewType)
ParseMagickOption(MagickPreviewOptions,MagickFalse,preview_type);
- image_info->group=(long) windows->image.id;
+ image_info->group=(ssize_t) windows->image.id;
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Preview");
(void) AcquireUniqueFilename(filename);
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- image_info->group=(long) windows->image.id;
+ image_info->group=(ssize_t) windows->image.id;
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Histogram");
(void) AcquireUniqueFilename(filename);
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- image_info->group=(long) windows->image.id;
+ image_info->group=(ssize_t) windows->image.id;
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Matte");
(void) AcquireUniqueFilename(filename);
}
case VersionCommand:
{
- XNoticeWidget(display,windows,GetMagickVersion((unsigned long *) NULL),
+ XNoticeWidget(display,windows,GetMagickVersion((size_t *) NULL),
GetMagickCopyright());
break;
}
x,
y;
- unsigned long
+ size_t
state;
/*
height,
width;
- unsigned long
+ size_t
state;
XEvent
*/
(void) GetOneVirtualPixel(*image,x_offset,y_offset,&target,
exception);
- for (y=0; y < (long) (*image)->rows; y++)
+ for (y=0; y < (ssize_t) (*image)->rows; y++)
{
q=GetAuthenticPixels(*image,0,y,(*image)->columns,1,
&(*image)->exception);
}
draw_info=CloneDrawInfo(resource_info->image_info,
(DrawInfo *) NULL);
- draw_info->fill.opacity=RoundToQuantum(StringToDouble(matte));
+ draw_info->fill.opacity=ClampToQuantum(StringToDouble(matte));
(void) FloodfillPaintImage(*image,OpacityChannel,draw_info,&target,
x_offset,y_offset,method == FloodfillMethod ? MagickFalse :
MagickTrue);
*/
if (SetImageStorageClass(*image,DirectClass) == MagickFalse)
return(MagickFalse);
- for (y=0; y < (long) (*image)->rows; y++)
+ for (y=0; y < (ssize_t) (*image)->rows; y++)
{
q=QueueAuthenticPixels(*image,0,y,(*image)->columns,1,exception);
if (q == (PixelPacket *) NULL)
(void *) NULL);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
exception=AcquireExceptionInfo();
- (void) SetImageInfo(image_info,MagickFalse,exception);
+ (void) SetImageInfo(image_info,0,exception);
if (LocaleCompare(image_info->magick,"X") == 0)
{
char
seconds);
if (*seconds == '\0')
return((Image *) NULL);
- XDelay(display,(unsigned long) (1000*StringToLong(seconds)));
+ XDelay(display,(size_t) (1000*StringToLong(seconds)));
}
magick_info=GetMagickInfo(image_info->magick,exception);
if ((magick_info != (const MagickInfo *) NULL) &&
RectangleInfo
pan_info;
- unsigned long
+ size_t
state;
/*
else
if ((int) (pan_info.x+windows->image.width) >
windows->image.ximage->width)
- pan_info.x=(long)
+ pan_info.x=(ssize_t)
(windows->image.ximage->width-windows->image.width);
- if (pan_info.y < (long) (pan_info.height/2))
+ if (pan_info.y < (ssize_t) (pan_info.height/2))
pan_info.y=0;
else
- pan_info.y=(long) (y_factor*(pan_info.y-(pan_info.height/2)));
+ pan_info.y=(ssize_t) (y_factor*(pan_info.y-(pan_info.height/2)));
if (pan_info.y < 0)
pan_info.y=0;
else
if ((int) (pan_info.y+windows->image.height) >
windows->image.ximage->height)
- pan_info.y=(long)
+ pan_info.y=(ssize_t)
(windows->image.ximage->height-windows->image.height);
if ((windows->image.x != (int) pan_info.x) ||
(windows->image.y != (int) pan_info.y))
height,
width;
- unsigned long
+ size_t
state;
XEvent
Display pointer position.
*/
(void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
- paste_info.x,paste_info.y);
+ (long) paste_info.x,(long) paste_info.y);
XInfoWidget(display,windows,text);
}
highlight_info=paste_info;
height,
width;
- unsigned long
+ size_t
state;
XEvent
Display pointer position.
*/
(void) FormatMagickString(text,MaxTextExtent," %+ld%+ld ",
- roi_info.x,roi_info.y);
+ (long) roi_info.x,(long) roi_info.y);
XInfoWidget(display,windows,text);
}
/*
*/
if (windows->info.mapped == MagickFalse)
(void) XMapWindow(display,windows->info.id);
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- roi_info.width,roi_info.height,roi_info.x,roi_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
+ roi_info.height,(double) roi_info.x,(double) roi_info.y);
XInfoWidget(display,windows,text);
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
/*
Display pointer position.
*/
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- roi_info.width,roi_info.height,roi_info.x,roi_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ " %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
+ roi_info.height,(double) roi_info.x,(double) roi_info.y);
XInfoWidget(display,windows,text);
}
highlight_info=roi_info;
(y < (int) (roi_info.y+RoiDelta)) &&
(y > (int) (roi_info.y-RoiDelta)))
{
- roi_info.x=(long) (roi_info.x+roi_info.width);
- roi_info.y=(long) (roi_info.y+roi_info.height);
+ roi_info.x=(ssize_t) (roi_info.x+roi_info.width);
+ roi_info.y=(ssize_t) (roi_info.y+roi_info.height);
state|=UpdateConfigurationState;
break;
}
(y < (int) (roi_info.y+roi_info.height+RoiDelta)) &&
(y > (int) (roi_info.y+roi_info.height-RoiDelta)))
{
- roi_info.x=(long) (roi_info.x+roi_info.width);
+ roi_info.x=(ssize_t) (roi_info.x+roi_info.width);
state|=UpdateConfigurationState;
break;
}
(y < (int) (roi_info.y+RoiDelta)) &&
(y > (int) (roi_info.y-RoiDelta)))
{
- roi_info.y=(long) (roi_info.y+roi_info.height);
+ roi_info.y=(ssize_t) (roi_info.y+roi_info.height);
state|=UpdateConfigurationState;
break;
}
case XK_Home:
case XK_KP_Home:
{
- roi_info.x=(long) (windows->image.width/2L-roi_info.width/2L);
- roi_info.y=(long) (windows->image.height/2L-roi_info.height/2L);
+ roi_info.x=(ssize_t) (windows->image.width/2L-roi_info.width/2L);
+ roi_info.y=(ssize_t) (windows->image.height/2L-roi_info.height/2L);
break;
}
case XK_Left:
/*
Set primary selection.
*/
- (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
- roi_info.width,roi_info.height,roi_info.x,roi_info.y);
+ (void) FormatMagickString(text,MaxTextExtent,
+ "%.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
+ roi_info.height,(double) roi_info.x,(double) roi_info.y);
request=(&(event.xselectionrequest));
(void) XChangeProperty(request->display,request->requestor,
request->property,request->target,8,PropModeReplace,
unsigned int
distance;
- unsigned long
+ size_t
state;
XEvent
}
image_info=CloneImageInfo(resource_info->image_info);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
- (void) SetImageInfo(image_info,MagickFalse,&image->exception);
+ (void) SetImageInfo(image_info,1,&image->exception);
if ((LocaleCompare(image_info->magick,"JPEG") == 0) ||
(LocaleCompare(image_info->magick,"JPG") == 0))
{
/*
Request JPEG quality from user.
*/
- (void) FormatMagickString(quality,MaxTextExtent,"%lu",image->quality);
+ (void) FormatMagickString(quality,MaxTextExtent,"%.20g",(double)
+ image->quality);
status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
quality);
if (*quality == '\0')
/*
Display info on cropping rectangle.
*/
- (void) FormatMagickString(text,MaxTextExtent," %lux%lu%+ld%+ld",
- crop_info->width,crop_info->height,crop_info->x,crop_info->y);
+ (void) FormatMagickString(text,MaxTextExtent," %.20gx%.20g%+.20g%+.20g",
+ (double) crop_info->width,(double) crop_info->height,(double)
+ crop_info->x,(double) crop_info->y);
XInfoWidget(display,windows,text);
}
/*
x,
y;
- unsigned long
+ size_t
background,
pixel;
Crop the left edge.
*/
background=XGetPixel(windows->image.ximage,0,0);
- trim_info.width=(unsigned long) windows->image.ximage->width;
+ trim_info.width=(size_t) windows->image.ximage->width;
for (x=0; x < windows->image.ximage->width; x++)
{
for (y=0; y < windows->image.ximage->height; y++)
if (y < windows->image.ximage->height)
break;
}
- trim_info.width=(unsigned long) (x-trim_info.x+1);
+ trim_info.width=(size_t) (x-trim_info.x+1);
/*
Crop the top edge.
*/
background=XGetPixel(windows->image.ximage,0,0);
- trim_info.height=(unsigned long) windows->image.ximage->height;
+ trim_info.height=(size_t) windows->image.ximage->height;
for (y=0; y < windows->image.ximage->height; y++)
{
for (x=0; x < windows->image.ximage->width; x++)
if (x < windows->image.ximage->width)
break;
}
- trim_info.height=(unsigned long) y-trim_info.y+1;
+ trim_info.height=(size_t) y-trim_info.y+1;
if (((unsigned int) trim_info.width != windows->image.width) ||
((unsigned int) trim_info.height != windows->image.height))
{
exception=AcquireExceptionInfo();
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- for (i=0; i < (long) number_files; i++)
+ for (i=0; i < (ssize_t) number_files; i++)
{
(void) CopyMagickString(read_info->filename,filelist[i],MaxTextExtent);
filelist[i]=DestroyString(filelist[i]);
static XWindowInfo
window_info;
- unsigned long
+ size_t
delay;
Window
context_values.background=pixel.background_color.pixel;
context_values.foreground=pixel.foreground_color.pixel;
pixel.annotate_context=XCreateGC(display,window_info.id,
- (unsigned long) (GCBackground | GCForeground),&context_values);
+ (size_t) (GCBackground | GCForeground),&context_values);
if (pixel.annotate_context == (GC) NULL)
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateGraphicContext",
image->filename);
window_attributes.width,window_attributes.height);
geometry_info.width=window_info.width;
geometry_info.height=window_info.height;
- geometry_info.x=window_info.x;
- geometry_info.y=window_info.y;
+ geometry_info.x=(ssize_t) window_info.x;
+ geometry_info.y=(ssize_t) window_info.y;
(void) ParseMetaGeometry(geometry,&geometry_info.x,&geometry_info.y,
&geometry_info.width,&geometry_info.height);
window_info.width=(unsigned int) geometry_info.width;
if (image->debug != MagickFalse)
{
(void) LogMagickEvent(X11Event,GetMagickModule(),
- "Image: %s[%lu] %lux%lu ",image->filename,image->scene,
- image->columns,image->rows);
+ "Image: %s[%.20g] %.20gx%.20g ",image->filename,(double) image->scene,
+ (double) image->columns,(double) image->rows);
if (image->colors != 0)
- (void) LogMagickEvent(X11Event,GetMagickModule(),"%luc ",image->colors);
+ (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
+ image->colors);
(void) LogMagickEvent(X11Event,GetMagickModule(),"%s",image->magick);
}
/*
% The format of the XDisplayImage method is:
%
% Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
-% char **argv,int argc,Image **image,unsigned long *state)
+% char **argv,int argc,Image **image,size_t *state)
%
% A description of each parameter follows:
%
%
*/
MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
- char **argv,int argc,Image **image,unsigned long *state)
+ char **argv,int argc,Image **image,size_t *state)
{
#define MagnifySize 256 /* must be a power of 2 */
#define MagickMenus 10
height,
width;
- unsigned long
+ size_t
delay;
WarningHandler
if (display_image->debug != MagickFalse)
{
(void) LogMagickEvent(X11Event,GetMagickModule(),
- "Image: %s[%lu] %lux%lu ",display_image->filename,
- display_image->scene,display_image->columns,display_image->rows);
+ "Image: %s[%.20g] %.20gx%.20g ",display_image->filename,
+ (double) display_image->scene,(double) display_image->columns,
+ (double) display_image->rows);
if (display_image->colors != 0)
- (void) LogMagickEvent(X11Event,GetMagickModule(),"%luc ",
+ (void) LogMagickEvent(X11Event,GetMagickModule(),"%.20gc ",(double)
display_image->colors);
(void) LogMagickEvent(X11Event,GetMagickModule(),"%s",
display_image->magick);
if (pixel->highlight_context != (GC) NULL)
(void) XFreeGC(display,pixel->highlight_context);
pixel->highlight_context=XCreateGC(display,windows->context.id,
- (unsigned long) (context_mask | GCPlaneMask),&context_values);
+ (size_t) (context_mask | GCPlaneMask),&context_values);
if (pixel->highlight_context == (GC) NULL)
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateGraphicContext",
display_image->filename);
context_values.background=icon_pixel->background_color.pixel;
context_values.foreground=icon_pixel->foreground_color.pixel;
icon_pixel->annotate_context=XCreateGC(display,windows->icon.id,
- (unsigned long) (GCBackground | GCForeground),&context_values);
+ (size_t) (GCBackground | GCForeground),&context_values);
if (icon_pixel->annotate_context == (GC) NULL)
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateGraphicContext",
display_image->filename);
GetPathComponent(display_image->magick_filename,TailPath,filename);
if (GetImageListLength(display_image) == 1)
(void) FormatMagickString(windows->image.name,MaxTextExtent,
- "ImageMagick: %s",filename);
+ "%s: %s",MagickPackageName,filename);
else
(void) FormatMagickString(windows->image.name,MaxTextExtent,
- "ImageMagick: %s[%lu of %lu]",filename,display_image->scene,
- GetImageListLength(display_image));
+ "%s: %s[%.20g of %.20g]",MagickPackageName,filename,(double)
+ display_image->scene,(double) GetImageListLength(display_image));
(void) CopyMagickString(windows->image.icon_name,filename,MaxTextExtent);
}
if (resource_info->immutable)
*/
windows->backdrop.x=0;
windows->backdrop.y=0;
- (void) CloneString(&windows->backdrop.name,"ImageMagick Backdrop");
- windows->backdrop.flags=(unsigned long) (USSize | USPosition);
+ (void) CloneString(&windows->backdrop.name,"Backdrop");
+ windows->backdrop.flags=(size_t) (USSize | USPosition);
windows->backdrop.width=(unsigned int)
XDisplayWidth(display,visual_info->screen);
windows->backdrop.height=(unsigned int)
context_values.plane_mask=context_values.background ^
context_values.foreground;
(void) XChangeGC(display,magick_windows[i]->highlight_context,
- (unsigned long) (context_mask | GCPlaneMask),
+ (size_t) (context_mask | GCPlaneMask),
&context_values);
magick_windows[i]->attributes.background_pixel=
pixel->background_color.pixel;
&window_changes);
}
}
- if ((event.xconfigure.width == (long) windows->image.width) &&
- (event.xconfigure.height == (long) windows->image.height))
+ if ((event.xconfigure.width == (int) windows->image.width) &&
+ (event.xconfigure.height == (int) windows->image.height))
break;
windows->image.width=(unsigned int) event.xconfigure.width;
windows->image.height=(unsigned int) event.xconfigure.height;
windows->image.x=vid_info.x;
windows->image.y=vid_info.y;
}
+ if ((windows->image.mapped != MagickFalse) &&
+ (windows->image.stasis != MagickFalse))
+ {
+ /*
+ Update image window configuration.
+ */
+ windows->image.window_changes.width=event.xconfigure.width;
+ windows->image.window_changes.height=event.xconfigure.height;
+ (void) XConfigureImage(display,resource_info,windows,
+ display_image);
+ }
/*
Update pan window configuration.
*/
/*
Refresh windows that are now exposed.
*/
- if (event.xexpose.window == windows->image.id)
- if (windows->image.mapped != MagickFalse)
- {
- XRefreshWindow(display,&windows->image,&event);
- delay=display_image->delay/MagickMax(
- display_image->ticks_per_second,1L);
- timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1;
- break;
- }
- if (event.xexpose.window == windows->magnify.id)
- if (event.xexpose.count == 0)
- if (windows->magnify.mapped != MagickFalse)
- {
- XMakeMagnifyImage(display,windows);
- break;
- }
+ if ((event.xexpose.window == windows->image.id) &&
+ (windows->image.mapped != MagickFalse))
+ {
+ XRefreshWindow(display,&windows->image,&event);
+ delay=display_image->delay/MagickMax(
+ display_image->ticks_per_second,1L);
+ timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1;
+ break;
+ }
+ if ((event.xexpose.window == windows->magnify.id) &&
+ (windows->magnify.mapped != MagickFalse))
+ {
+ XMakeMagnifyImage(display,windows);
+ break;
+ }
if (event.xexpose.window == windows->pan.id)
- if (event.xexpose.count == 0)
- {
- XDrawPanRectangle(display,windows);
- break;
- }
+ {
+ XDrawPanRectangle(display,windows);
+ break;
+ }
if (event.xexpose.window == windows->icon.id)
- if (event.xexpose.count == 0)
- {
- XRefreshWindow(display,&windows->icon,&event);
- break;
- }
+ {
+ XRefreshWindow(display,&windows->icon,&event);
+ break;
+ }
break;
}
case KeyPress: