resource_info;
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(images != (Image *) NULL);
- assert(images->signature == MagickSignature);
+ assert(images->signature == MagickCoreSignature);
if (IfMagickTrue(images->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
display=XOpenDisplay(image_info->server_name);
status;
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(filename != (char *) NULL);
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
display=XOpenDisplay(image_info->server_name);
(void) XSetErrorHandler(XError);
status=XRemoteCommand(display,window,filename);
(void) XCloseDisplay(display);
- return(IsMagickTrue(status));
+ return(status != 0 ? MagickTrue : MagickFalse);
}
\f
/*
%
*/
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
-{
- if (x > y)
- return(x);
- return(y);
-}
-
-static inline ssize_t MagickMin(const ssize_t x,const ssize_t y)
-{
- if (x < y)
- return(x);
- return(y);
-}
-
static MagickBooleanType XAnnotateEditImage(Display *display,
XResourceInfo *resource_info,XWindows *windows,Image *image,
ExceptionInfo *exception)
pen_id = 0;
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
const char
*ColorMenu[MaxNumberPens+1];
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
if (font_number == (MaxNumberFonts-2))
{
static char
- font_name[MaxTextExtent] = "fixed";
+ font_name[MagickPathExtent] = "fixed";
/*
Select a font name from a browser.
if (pen_number == (MaxNumberPens-1))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
if (pen_number == (MaxNumberPens-1))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
entry;
static char
- angle[MaxTextExtent] = "30.0";
+ angle[MagickPathExtent] = "30.0";
static const char
*RotateMenu[] =
if (event.xselection.property == (Atom) None)
break;
status=XGetWindowProperty(display,event.xselection.requestor,
- event.xselection.property,0L,(long) MaxTextExtent,True,XA_STRING,
+ event.xselection.property,0L,(long) MagickPathExtent,True,XA_STRING,
&type,&format,&length,&after,&data);
if ((status != Success) || (type != XA_STRING) || (format == 32) ||
(length == 0))
width*(annotate_info->x+windows->image.x)/windows->image.ximage->width;
annotate_info->y=(int) height*(annotate_info->y-font_info->ascent+
windows->image.y)/windows->image.ximage->height;
- (void) FormatLocaleString(annotate_info->geometry,MaxTextExtent,
+ (void) FormatLocaleString(annotate_info->geometry,MagickPathExtent,
"%ux%u%+d%+d",width*annotate_info->width/windows->image.ximage->width,
height*annotate_info->height/windows->image.ximage->height,
annotate_info->x+x,annotate_info->y+y);
status;
static char
- window_id[MaxTextExtent] = "root";
+ window_id[MagickPathExtent] = "root";
XResourceInfo
background_resources;
XCheckRefreshWindows(display,windows);
background_resources=(*resource_info);
background_resources.window_id=window_id;
- background_resources.backdrop=IsMagickTrue(status);
+ background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse;
status=XDisplayBackgroundImage(display,&background_resources,*image,
exception);
if (IfMagickTrue(status))
};
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
Image
*chop_image;
(void) XSelectInput(display,windows->image.id,
windows->image.attributes.event_mask | PointerMotionMask);
state=DefaultState;
+ (void) ResetMagickMemory(&segment_info,0,sizeof(segment_info));
do
{
if (IfMagickTrue(windows->info.mapped) )
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
case ChopDirectionCommand:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
static const char
*Directions[] =
case KeyPress:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
KeySym
key_symbol;
*/
if (IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) chop_info.width,(double)
chop_info.height,(double) chop_info.x,(double) chop_info.y);
XInfoWidget(display,windows,text);
border_color = { 0, 0, 0, 0, 0, 0 };
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
Cursor
cursor;
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
if (pen_number == (MaxNumberPens-2))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
if (pen_number == (MaxNumberPens-2))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
case ColorEditFuzzCommand:
{
static char
- fuzz[MaxTextExtent];
+ fuzz[MagickPathExtent];
static const char
*FuzzMenu[] =
QuantumRange+1.0);
break;
}
- (void) (void) CopyMagickString(fuzz,"20%",MaxTextExtent);
+ (void) (void) CopyMagickString(fuzz,"20%",MagickPathExtent);
(void) XDialogWidget(display,windows,"Ok",
"Enter fuzz factor (0.0 - 99.9%):",fuzz);
if (*fuzz == '\0')
break;
- (void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
+ (void) ConcatenateMagickString(fuzz,"%",MagickPathExtent);
(*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
1.0);
break;
AllCompliance,&draw_info->fill,exception);
(void) FloodfillPaintImage(*image,draw_info,&target,
(ssize_t)x_offset,(ssize_t)y_offset,
- IsMagickFalse(method == FloodfillMethod),exception);
+ method != FloodfillMethod ? MagickTrue : MagickFalse,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
ExceptionInfo *exception)
{
static char
- displacement_geometry[MaxTextExtent] = "30x30",
- filename[MaxTextExtent] = "\0";
+ displacement_geometry[MagickPathExtent] = "30x30",
+ filename[MagickPathExtent] = "\0";
static const char
*CompositeMenu[] =
};
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
Cursor
cursor;
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(resource_info->image_info->filename,filename,
- MaxTextExtent);
+ MagickPathExtent);
composite_image=ReadImage(resource_info->image_info,exception);
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
(long) composite_info.x,(long) composite_info.y);
XInfoWidget(display,windows,text);
}
case CompositeOperatorsCommand:
{
char
- command[MaxTextExtent],
+ command[MagickPathExtent],
**operators;
/*
case CompositeDissolveCommand:
{
static char
- factor[MaxTextExtent] = "20.0";
+ factor[MagickPathExtent] = "20.0";
/*
Dissolve the two images a given percent.
case KeyPress:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
KeySym
key_symbol;
ExceptionInfo *exception)
{
char
- geometry[MaxTextExtent];
+ geometry[MagickPathExtent];
MagickStatusType
status;
Notify window manager of the new configuration.
*/
if (resource_info->image_geometry != (char *) NULL)
- (void) FormatLocaleString(geometry,MaxTextExtent,"%s>!",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%s>!",
resource_info->image_geometry);
else
- (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%ux%u+0+0>!",
XDisplayWidth(display,windows->image.screen),
XDisplayHeight(display,windows->image.screen));
(void) ParseMetaGeometry(geometry,&x,&y,&width,&height);
(void) XReconfigureWMWindow(display,windows->icon.id,windows->icon.screen,
(unsigned int) (CWWidth | CWHeight),&window_changes);
XSetCursorState(display,windows,MagickFalse);
- return(IsMagickTrue(status));
+ return(status != 0 ? MagickTrue : MagickFalse);
}
\f
/*
*image_view;
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
Cursor
cursor;
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
(long) crop_info.x,(long) crop_info.y);
XInfoWidget(display,windows,text);
}
*/
if (IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
XInfoWidget(display,windows,text);
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
XInfoWidget(display,windows,text);
case XK_Home:
case XK_KP_Home:
{
- 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);
+ 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) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
request=(&(event.xselectionrequest));
line_width = 1;
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
Cursor
cursor;
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
if (pen_number == (MaxNumberPens-1))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
status;
static char
- filename[MaxTextExtent] = "\0";
+ filename[MagickPathExtent] = "\0";
static const char
*StipplesMenu[] =
XCheckRefreshWindows(display,windows);
image_info=AcquireImageInfo();
(void) CopyMagickString(image_info->filename,filename,
- MaxTextExtent);
+ MagickPathExtent);
stipple_image=ReadImage(image_info,exception);
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (stipple_image == (Image *) NULL)
break;
(void) AcquireUniqueFileResource(filename);
- (void) FormatLocaleString(stipple_image->filename,MaxTextExtent,
+ (void) FormatLocaleString(stipple_image->filename,MagickPathExtent,
"xbm:%s",filename);
(void) WriteImage(image_info,stipple_image,exception);
stipple_image=DestroyImage(stipple_image);
case DrawWidthCommand:
{
static char
- width[MaxTextExtent] = "0";
+ width[MagickPathExtent] = "0";
static const char
*WidthsMenu[] =
(void) XDrawLines(display,windows->image.id,
windows->image.highlight_context,coordinate_info,
number_coordinates,CoordModeOrigin);
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d",
coordinate_info[number_coordinates-1].x,
coordinate_info[number_coordinates-1].y);
XInfoWidget(display,windows,text);
*/
degrees=RadiansToDegrees(-atan2((double) (line_info.y2-
line_info.y1),(double) (line_info.x2-line_info.x1)));
- (void) FormatLocaleString(text,MaxTextExtent," %g",
+ (void) FormatLocaleString(text,MagickPathExtent," %g",
(double) degrees);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
/*
Display info and draw drawing rectangle.
*/
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
(double) rectangle_info.height,(double) rectangle_info.x,
(double) rectangle_info.y);
/*
Display info and draw drawing rectangle.
*/
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
(double) rectangle_info.height,(double) rectangle_info.x,
(double) rectangle_info.y);
*/
degrees=RadiansToDegrees(-atan2((double) (line_info.y2-
line_info.y1),(double) (line_info.x2-line_info.x1)));
- (void) FormatLocaleString(text,MaxTextExtent," %g",
+ (void) FormatLocaleString(text,MagickPathExtent," %g",
(double) degrees);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
draw_info.height=(unsigned int) rectangle_info.height+(line_width << 1);
if (draw_info.height > (unsigned int) (*image)->rows)
draw_info.height=(unsigned int) (*image)->rows;
- (void) FormatLocaleString(draw_info.geometry,MaxTextExtent,"%ux%u%+d%+d",
+ (void) FormatLocaleString(draw_info.geometry,MagickPathExtent,"%ux%u%+d%+d",
width*draw_info.width/windows->image.ximage->width,
height*draw_info.height/windows->image.ximage->height,
draw_info.x+x,draw_info.y+y);
}
XSetCursorState(display,windows,MagickFalse);
coordinate_info=(XPoint *) RelinquishMagickMemory(coordinate_info);
- return(IsMagickTrue(status));
+ return(status != 0 ? MagickTrue : MagickFalse);
}
\f
/*
case UndoCommand:
{
char
- image_geometry[MaxTextExtent];
+ image_geometry[MagickPathExtent];
/*
Undo the last image transformation.
undo_image=GetPreviousImageInList(undo_image);
windows->image.window_changes.width=(int) cache_image->columns;
windows->image.window_changes.height=(int) cache_image->rows;
- (void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(image_geometry,MagickPathExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(image,windows->image.crop_geometry,image_geometry,
exception);
{
cache_image->geometry=AcquireString((char *) NULL);
(void) CopyMagickString(cache_image->geometry,
- windows->image.crop_geometry,MaxTextExtent);
+ windows->image.crop_geometry,MagickPathExtent);
}
if (undo_image == (Image *) NULL)
{
KeySym key_symbol,Image **image,ExceptionInfo *exception)
{
static char
- delta[MaxTextExtent] = "";
+ delta[MagickPathExtent] = "";
static const char
Digits[] = "01234567890";
ExceptionInfo *exception)
{
char
- filename[MaxTextExtent],
- geometry[MaxTextExtent],
- modulate_factors[MaxTextExtent];
+ filename[MagickPathExtent],
+ geometry[MagickPathExtent],
+ modulate_factors[MagickPathExtent];
GeometryInfo
geometry_info;
i;
static char
- color[MaxTextExtent] = "gray";
+ color[MagickPathExtent] = "gray";
unsigned int
height,
*/
if (*resource_info->home_directory == '\0')
(void) CopyMagickString(resource_info->home_directory,".",
- MaxTextExtent);
+ MagickPathExtent);
status=chdir(resource_info->home_directory);
if (status == -1)
(void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
if (IfMagickFalse(status) )
{
char
- message[MaxTextExtent];
+ message[MagickPathExtent];
- (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",
+ (void) FormatLocaleString(message,MagickPathExtent,"%s:%s",
exception->reason != (char *) NULL ? exception->reason : "",
exception->description != (char *) NULL ? exception->description :
"");
if (IfMagickFalse(status) )
{
char
- message[MaxTextExtent];
+ message[MagickPathExtent];
- (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",
+ (void) FormatLocaleString(message,MagickPathExtent,"%s:%s",
exception->reason != (char *) NULL ? exception->reason : "",
exception->description != (char *) NULL ? exception->description :
"");
case DeleteCommand:
{
static char
- filename[MaxTextExtent] = "\0";
+ filename[MagickPathExtent] = "\0";
/*
Delete image file.
status;
static char
- color[MaxTextExtent] = "gray",
- geometry[MaxTextExtent] = "640x480";
+ color[MagickPathExtent] = "gray",
+ geometry[MagickPathExtent] = "640x480";
static const char
*format = "gradient";
/*
Create canvas.
*/
- (void) FormatLocaleString(image_info->filename,MaxTextExtent,
+ (void) FormatLocaleString(image_info->filename,MagickPathExtent,
"%s:%s",format,color);
(void) CloneString(&image_info->size,geometry);
nexus=ReadImage(image_info,exception);
height=(size_t) windows->image.ximage->height;
x=0;
y=0;
- (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g+0+0",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g+0+0",
(double) width,(double) height);
status=XDialogWidget(display,windows,"Resize",
"Enter resize geometry (e.g. 640x480, 200%):",geometry);
if (*geometry == '\0')
break;
if (status == 0)
- (void) ConcatenateMagickString(geometry,"!",MaxTextExtent);
+ (void) ConcatenateMagickString(geometry,"!",MagickPathExtent);
(void) ParseMetaGeometry(geometry,&x,&y,&width,&height);
windows->image.window_changes.width=(int) width;
windows->image.window_changes.height=(int) height;
case ApplyCommand:
{
char
- image_geometry[MaxTextExtent];
+ image_geometry[MagickPathExtent];
if ((windows->image.crop_geometry == (char *) NULL) &&
((int) (*image)->columns == windows->image.ximage->width) &&
/*
Crop and/or scale displayed image.
*/
- (void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(image_geometry,MagickPathExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(image,windows->image.crop_geometry,image_geometry,
exception);
height=(unsigned int) (*image)->rows;
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,
&width,&height);
- (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
"%ux%u%+d%+d",width,height,(int) (*image)->columns-(int) width-x,y);
}
if (IfMagickTrue(windows->image.orphan) )
height=(unsigned int) (*image)->rows;
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,
&width,&height);
- (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
"%ux%u%+d%+d",width,height,x,(int) (*image)->rows-(int) height-y);
}
if (IfMagickTrue(windows->image.orphan) )
*shear_image;
static char
- geometry[MaxTextExtent] = "45.0x45.0";
+ geometry[MagickPathExtent] = "45.0x45.0";
/*
Query user for shear color and geometry.
*roll_image;
static char
- geometry[MaxTextExtent] = "+2+2";
+ geometry[MagickPathExtent] = "+2+2";
/*
Query user for the roll geometry.
case TrimCommand:
{
static char
- fuzz[MaxTextExtent];
+ fuzz[MagickPathExtent];
/*
Query user for the fuzz factor.
*/
- (void) FormatLocaleString(fuzz,MaxTextExtent,"%g%%",100.0*
+ (void) FormatLocaleString(fuzz,MagickPathExtent,"%g%%",100.0*
(*image)->fuzz/(QuantumRange+1.0));
(void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz);
if (*fuzz == '\0')
case HueCommand:
{
static char
- hue_percent[MaxTextExtent] = "110";
+ hue_percent[MagickPathExtent] = "110";
/*
Query user for percent hue change.
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) CopyMagickString(modulate_factors,"100.0/100.0/",MaxTextExtent);
+ (void) CopyMagickString(modulate_factors,"100.0/100.0/",MagickPathExtent);
(void) ConcatenateMagickString(modulate_factors,hue_percent,
- MaxTextExtent);
+ MagickPathExtent);
(void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
if (IfMagickTrue(windows->image.orphan) )
case SaturationCommand:
{
static char
- saturation_percent[MaxTextExtent] = "110";
+ saturation_percent[MagickPathExtent] = "110";
/*
Query user for percent saturation change.
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) CopyMagickString(modulate_factors,"100.0/",MaxTextExtent);
+ (void) CopyMagickString(modulate_factors,"100.0/",MagickPathExtent);
(void) ConcatenateMagickString(modulate_factors,saturation_percent,
- MaxTextExtent);
+ MagickPathExtent);
(void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
if (IfMagickTrue(windows->image.orphan) )
case BrightnessCommand:
{
static char
- brightness_percent[MaxTextExtent] = "110";
+ brightness_percent[MagickPathExtent] = "110";
/*
Query user for percent brightness change.
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(modulate_factors,brightness_percent,
- MaxTextExtent);
+ MagickPathExtent);
(void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
if (IfMagickTrue(windows->image.orphan) )
case GammaCommand:
{
static char
- factor[MaxTextExtent] = "1.6";
+ factor[MagickPathExtent] = "1.6";
/*
Query user for gamma value.
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) GammaImage(*image,atof(factor),exception);
+ (void) GammaImage(*image,strtod(factor,(char **) NULL),exception);
XSetCursorState(display,windows,MagickFalse);
if (IfMagickTrue(windows->image.orphan) )
break;
white_point;
static char
- levels[MaxTextExtent] = "1%";
+ levels[MagickPathExtent] = "1%";
/*
Query user for gamma value.
flags;
static char
- levels[MaxTextExtent] = "3x50%";
+ levels[MagickPathExtent] = "3x50%";
/*
Query user for gamma value.
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) SetImageType(*image,(*image)->alpha_trait == UndefinedPixelTrait ?
- GrayscaleType : GrayscaleMatteType,exception);
+ GrayscaleType : GrayscaleAlphaType,exception);
XSetCursorState(display,windows,MagickFalse);
if (IfMagickTrue(windows->image.orphan) )
break;
*affinity_image;
static char
- filename[MaxTextExtent] = "\0";
+ filename[MagickPathExtent] = "\0";
/*
Request image file name from user.
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
affinity_image=ReadImage(image_info,exception);
if (affinity_image != (Image *) NULL)
{
status;
static char
- colors[MaxTextExtent] = "256";
+ colors[MagickPathExtent] = "256";
/*
Query user for maximum number of colors.
*emboss_image;
static char
- radius[MaxTextExtent] = "0.0x1.0";
+ radius[MagickPathExtent] = "0.0x1.0";
/*
Query user for emboss radius.
*noise_image;
static char
- radius[MaxTextExtent] = "0";
+ radius[MagickPathExtent] = "0";
/*
Query user for noise radius.
*noise_image;
static char
- noise_type[MaxTextExtent] = "Gaussian";
+ noise_type[MagickPathExtent] = "Gaussian";
/*
Add noise to the image.
*sharp_image;
static char
- radius[MaxTextExtent] = "0.0x1.0";
+ radius[MagickPathExtent] = "0.0x1.0";
/*
Query user for sharpen radius.
*blur_image;
static char
- radius[MaxTextExtent] = "0.0x1.0";
+ radius[MagickPathExtent] = "0.0x1.0";
/*
Query user for blur radius.
threshold;
static char
- factor[MaxTextExtent] = "128";
+ factor[MagickPathExtent] = "128";
/*
Query user for threshold value.
*edge_image;
static char
- radius[MaxTextExtent] = "0";
+ radius[MagickPathExtent] = "0";
/*
Query user for edge factor.
*spread_image;
static char
- amount[MaxTextExtent] = "2";
+ amount[MagickPathExtent] = "2";
/*
Query user for spread amount.
status;
static char
- geometry[MaxTextExtent] = "30x30";
+ geometry[MagickPathExtent] = "30x30";
/*
Query user for the shade geometry.
flags=ParseGeometry(geometry,&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
- shade_image=ShadeImage(*image,IsMagickTrue(status),
+ shade_image=ShadeImage(*image,status != 0 ? MagickTrue : MagickFalse,
geometry_info.rho,geometry_info.sigma,exception);
if (shade_image != (Image *) NULL)
{
case RaiseCommand:
{
static char
- bevel_width[MaxTextExtent] = "10";
+ bevel_width[MagickPathExtent] = "10";
/*
Query user for bevel width.
case SegmentCommand:
{
static char
- threshold[MaxTextExtent] = "1.0x1.5";
+ threshold[MagickPathExtent] = "1.0x1.5";
/*
Query user for smoothing threshold.
*sepia_image;
static char
- factor[MaxTextExtent] = "80%";
+ factor[MagickPathExtent] = "80%";
/*
Query user for sepia-tone factor.
threshold;
static char
- factor[MaxTextExtent] = "60%";
+ factor[MagickPathExtent] = "60%";
/*
Query user for solarize factor.
*swirl_image;
static char
- degrees[MaxTextExtent] = "60";
+ degrees[MagickPathExtent] = "60";
/*
Query user for swirl angle.
*implode_image;
static char
- factor[MaxTextExtent] = "0.3";
+ factor[MagickPathExtent] = "0.3";
/*
Query user for implode factor.
*vignette_image;
static char
- geometry[MaxTextExtent] = "0x20";
+ geometry[MagickPathExtent] = "0x20";
/*
Query user for the vignette geometry.
*wave_image;
static char
- geometry[MaxTextExtent] = "25x150";
+ geometry[MagickPathExtent] = "25x150";
/*
Query user for the wave geometry.
*paint_image;
static char
- radius[MaxTextExtent] = "0";
+ radius[MagickPathExtent] = "0";
/*
Query user for circular neighborhood radius.
*charcoal_image;
static char
- radius[MaxTextExtent] = "0x1";
+ radius[MagickPathExtent] = "0x1";
/*
Query user for charcoal radius.
*border_image;
static char
- geometry[MaxTextExtent] = "6x6";
+ geometry[MagickPathExtent] = "6x6";
/*
Query user for border color and geometry.
*frame_image;
static char
- geometry[MaxTextExtent] = "6x6";
+ geometry[MagickPathExtent] = "6x6";
/*
Query user for frame color and geometry.
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) AcquireUniqueFilename(filename);
- (void) FormatLocaleString((*image)->filename,MaxTextExtent,"launch:%s",
+ (void) FormatLocaleString((*image)->filename,MagickPathExtent,"launch:%s",
filename);
status=WriteImage(image_info,*image,exception);
if (IfMagickFalse(status) )
*preview_image;
static char
- preview_type[MaxTextExtent] = "Gamma";
+ preview_type[MagickPathExtent] = "Gamma";
/*
Select preview type from menu.
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Preview",exception);
(void) AcquireUniqueFilename(filename);
- (void) FormatLocaleString((*image)->filename,MaxTextExtent,"preview:%s",
+ (void) FormatLocaleString((*image)->filename,MagickPathExtent,"preview:%s",
filename);
status=WriteImage(image_info,*image,exception);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
preview_image=ReadImage(image_info,exception);
(void) RelinquishUniqueFileResource(filename);
if (preview_image == (Image *) NULL)
break;
- (void) FormatLocaleString(preview_image->filename,MaxTextExtent,"show:%s",
+ (void) FormatLocaleString(preview_image->filename,MagickPathExtent,"show:%s",
filename);
status=WriteImage(image_info,preview_image,exception);
preview_image=DestroyImage(preview_image);
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Histogram",exception);
(void) AcquireUniqueFilename(filename);
- (void) FormatLocaleString((*image)->filename,MaxTextExtent,"histogram:%s",
+ (void) FormatLocaleString((*image)->filename,MagickPathExtent,"histogram:%s",
filename);
status=WriteImage(image_info,*image,exception);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
histogram_image=ReadImage(image_info,exception);
(void) RelinquishUniqueFileResource(filename);
if (histogram_image == (Image *) NULL)
break;
- (void) FormatLocaleString(histogram_image->filename,MaxTextExtent,
+ (void) FormatLocaleString(histogram_image->filename,MagickPathExtent,
"show:%s",filename);
status=WriteImage(image_info,histogram_image,exception);
histogram_image=DestroyImage(histogram_image);
(void) DeleteImageProperty(*image,"label");
(void) SetImageProperty(*image,"label","Matte",exception);
(void) AcquireUniqueFilename(filename);
- (void) FormatLocaleString((*image)->filename,MaxTextExtent,"matte:%s",
+ (void) FormatLocaleString((*image)->filename,MagickPathExtent,"matte:%s",
filename);
status=WriteImage(image_info,*image,exception);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
matte_image=ReadImage(image_info,exception);
(void) RelinquishUniqueFileResource(filename);
if (matte_image == (Image *) NULL)
break;
- (void) FormatLocaleString(matte_image->filename,MaxTextExtent,"show:%s",
+ (void) FormatLocaleString(matte_image->filename,MagickPathExtent,"show:%s",
filename);
status=WriteImage(image_info,matte_image,exception);
matte_image=DestroyImage(matte_image);
case SlideShowCommand:
{
static char
- delay[MaxTextExtent] = "5";
+ delay[MagickPathExtent] = "5";
/*
Display next image after pausing.
if (mozilla_window != (Window) NULL)
{
char
- command[MaxTextExtent],
+ command[MagickPathExtent],
*url;
/*
Display documentation using Netscape remote control.
*/
url=GetMagickHomeURL();
- (void) FormatLocaleString(command,MaxTextExtent,
+ (void) FormatLocaleString(command,MagickPathExtent,
"openurl(%s,new-tab)",url);
url=DestroyString(url);
mozilla_atom=XInternAtom(display,"_MOZILLA_COMMAND",MagickFalse);
ExceptionInfo *exception)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
register int
x,
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
windows->magnify.x,windows->magnify.y);
XInfoWidget(display,windows,text);
}
ExceptionInfo *exception)
{
static char
- matte[MaxTextExtent] = "0";
+ matte[MagickPathExtent] = "0";
static const char
*MatteEditMenu[] =
border_color = { 0, 0, 0, 0, 0, 0 };
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
Cursor
cursor;
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
x+windows->image.x,y+windows->image.y);
XInfoWidget(display,windows,text);
}
if (pen_number == (MaxNumberPens-2))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
case MatteEditFuzzCommand:
{
static char
- fuzz[MaxTextExtent];
+ fuzz[MagickPathExtent];
static const char
*FuzzMenu[] =
QuantumRange+1.0);
break;
}
- (void) CopyMagickString(fuzz,"20%",MaxTextExtent);
+ (void) CopyMagickString(fuzz,"20%",MagickPathExtent);
(void) XDialogWidget(display,windows,"Ok",
"Enter fuzz factor (0.0 - 99.9%):",fuzz);
if (*fuzz == '\0')
break;
- (void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
+ (void) ConcatenateMagickString(fuzz,"%",MagickPathExtent);
(*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
1.0);
break;
case MatteEditValueCommand:
{
static char
- message[MaxTextExtent];
+ message[MagickPathExtent];
static const char
*MatteMenu[] =
break;
if (entry != 2)
{
- (void) FormatLocaleString(matte,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(matte,MagickPathExtent,QuantumFormat,
OpaqueAlpha);
if (LocaleCompare(MatteMenu[entry],"Transparent") == 0)
- (void) FormatLocaleString(matte,MaxTextExtent,QuantumFormat,
+ (void) FormatLocaleString(matte,MagickPathExtent,QuantumFormat,
(Quantum) TransparentAlpha);
break;
}
- (void) FormatLocaleString(message,MaxTextExtent,
+ (void) FormatLocaleString(message,MagickPathExtent,
"Enter matte value (0 - " QuantumFormat "):",(Quantum)
QuantumRange);
(void) XDialogWidget(display,windows,"Matte",message,matte);
case KeyPress:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
KeySym
key_symbol;
channel_mask=SetImageChannelMask(*image,AlphaChannel);
(void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
x_offset,(ssize_t) y_offset,
- IsMagickFalse(method == FloodfillMethod),exception);
+ method != FloodfillMethod ? MagickTrue : MagickFalse,exception);
(void) SetPixelChannelMask(*image,channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
*image_info;
static char
- filename[MaxTextExtent] = "\0";
+ filename[MagickPathExtent] = "\0";
/*
Request file name from user.
image_info=CloneImageInfo(resource_info->image_info);
(void) SetImageInfoProgressMonitor(image_info,(MagickProgressMonitor) NULL,
(void *) NULL);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
exception=AcquireExceptionInfo();
(void) SetImageInfo(image_info,0,exception);
if (LocaleCompare(image_info->magick,"X") == 0)
{
char
- seconds[MaxTextExtent];
+ seconds[MagickPathExtent];
/*
User may want to delay the X server screen grab.
*/
- (void) CopyMagickString(seconds,"0",MaxTextExtent);
+ (void) CopyMagickString(seconds,"0",MagickPathExtent);
(void) XDialogWidget(display,windows,"Grab","Enter any delay in seconds:",
seconds);
if (*seconds == '\0')
}
magick_info=GetMagickInfo(image_info->magick,exception);
if ((magick_info != (const MagickInfo *) NULL) &&
- IfMagickTrue(magick_info->raw))
+ GetMagickRawSupport(magick_info) == MagickTrue)
{
char
- geometry[MaxTextExtent];
+ geometry[MagickPathExtent];
/*
Request image size from the user.
*/
- (void) CopyMagickString(geometry,"512x512",MaxTextExtent);
+ (void) CopyMagickString(geometry,"512x512",MagickPathExtent);
if (image_info->size != (char *) NULL)
- (void) CopyMagickString(geometry,image_info->size,MaxTextExtent);
+ (void) CopyMagickString(geometry,image_info->size,MagickPathExtent);
(void) XDialogWidget(display,windows,"Load","Enter the image geometry:",
geometry);
(void) CloneString(&image_info->size,geometry);
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
nexus=ReadImage(image_info,exception);
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (textlist != (char **) NULL)
{
char
- title[MaxTextExtent];
+ title[MagickPathExtent];
register int
i;
- (void) FormatLocaleString(title,MaxTextExtent,
+ (void) FormatLocaleString(title,MagickPathExtent,
"Unknown format: %s",filename);
XTextViewWidget(display,resource_info,windows,MagickTrue,title,
(const char **) textlist);
ExceptionInfo *exception)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
Cursor
cursor;
*/
windows->image.x=(int) pan_info.x;
windows->image.y=(int) pan_info.y;
- (void) FormatLocaleString(text,MaxTextExtent," %ux%u%+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %ux%u%+d%+d ",
windows->image.width,windows->image.height,windows->image.x,
windows->image.y);
XInfoWidget(display,windows,text);
compose = CopyCompositeOp;
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
Cursor
cursor;
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
(long) paste_info.x,(long) paste_info.y);
XInfoWidget(display,windows,text);
}
case PasteOperatorsCommand:
{
char
- command[MaxTextExtent],
+ command[MagickPathExtent],
**operators;
/*
case KeyPress:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
KeySym
key_symbol;
ExceptionInfo *exception)
{
char
- filename[MaxTextExtent],
- geometry[MaxTextExtent];
+ filename[MagickPathExtent],
+ geometry[MagickPathExtent];
Image
*print_image;
Request Postscript page geometry from user.
*/
image_info=CloneImageInfo(resource_info->image_info);
- (void) FormatLocaleString(geometry,MaxTextExtent,"Letter");
+ (void) FormatLocaleString(geometry,MagickPathExtent,"Letter");
if (image_info->page != (char *) NULL)
- (void) CopyMagickString(geometry,image_info->page,MaxTextExtent);
+ (void) CopyMagickString(geometry,image_info->page,MagickPathExtent);
XListBrowserWidget(display,windows,&windows->widget,PageSizes,"Select",
"Select Postscript Page Geometry:",geometry);
if (*geometry == '\0')
print_image=CloneImage(image,0,0,MagickTrue,exception);
if (print_image == (Image *) NULL)
return(MagickFalse);
- (void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(&print_image,windows->image.crop_geometry,geometry,
exception);
Print image.
*/
(void) AcquireUniqueFilename(filename);
- (void) FormatLocaleString(print_image->filename,MaxTextExtent,"print:%s",
+ (void) FormatLocaleString(print_image->filename,MagickPathExtent,"print:%s",
filename);
status=WriteImage(image_info,print_image,exception);
(void) RelinquishUniqueFileResource(filename);
print_image=DestroyImage(print_image);
image_info=DestroyImageInfo(image_info);
XSetCursorState(display,windows,MagickFalse);
- return(IsMagickTrue(status));
+ return(status != 0 ? MagickTrue : MagickFalse);
}
\f
/*
};
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
CommandType
command_type;
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+ (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
(long) roi_info.x,(long) roi_info.y);
XInfoWidget(display,windows,text);
}
*/
if (IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
roi_info.height,(double) roi_info.x,(double) roi_info.y);
XInfoWidget(display,windows,text);
/*
Display pointer position.
*/
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
" %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
roi_info.height,(double) roi_info.x,(double) roi_info.y);
XInfoWidget(display,windows,text);
id=XCommandWidget(display,windows,ApplyMenu,&event);
if (id >= 0)
{
- (void) CopyMagickString(command,ApplyMenu[id],MaxTextExtent);
+ (void) CopyMagickString(command,ApplyMenu[id],MagickPathExtent);
command_type=ApplyCommands[id];
if (id < ApplyMenus)
{
if (entry >= 0)
{
(void) CopyMagickString(command,Menus[id][entry],
- MaxTextExtent);
+ MagickPathExtent);
command_type=Commands[id][entry];
}
}
/*
Set primary selection.
*/
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
roi_info.height,(double) roi_info.x,(double) roi_info.y);
request=(&(event.xselectionrequest));
pen_id = 0;
char
- command[MaxTextExtent],
- text[MaxTextExtent];
+ command[MagickPathExtent],
+ text[MagickPathExtent];
Image
*rotate_image;
if (pen_number == (MaxNumberPens-2))
{
static char
- color_name[MaxTextExtent] = "gray";
+ color_name[MagickPathExtent] = "gray";
/*
Select a pen color from a dialog.
case KeyPress:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
KeySym
key_symbol;
*/
if (IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
- (void) FormatLocaleString(text,MaxTextExtent," %g",
+ (void) FormatLocaleString(text,MagickPathExtent," %g",
direction == VerticalRotateCommand ? degrees-90.0 : degrees);
XInfoWidget(display,windows,text);
XHighlightLine(display,windows->image.id,
/*
Rotate 90 degrees.
*/
- (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
"%ux%u%+d%+d",height,width,(int) (*image)->columns-
(int) height-y,x);
break;
/*
Rotate 180 degrees.
*/
- (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
"%ux%u%+d%+d",width,height,(int) width-x,(int) height-y);
break;
}
/*
Rotate 270 degrees.
*/
- (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
"%ux%u%+d%+d",height,width,y,(int) (*image)->rows-(int) width-x);
break;
}
ExceptionInfo *exception)
{
char
- filename[MaxTextExtent],
- geometry[MaxTextExtent];
+ filename[MagickPathExtent],
+ geometry[MagickPathExtent];
Image
*save_image;
*/
if (resource_info->write_filename != (char *) NULL)
(void) CopyMagickString(filename,resource_info->write_filename,
- MaxTextExtent);
+ MagickPathExtent);
else
{
char
- path[MaxTextExtent];
+ path[MagickPathExtent];
int
status;
return(MagickTrue);
}
image_info=CloneImageInfo(resource_info->image_info);
- (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
(void) SetImageInfo(image_info,1,exception);
if ((LocaleCompare(image_info->magick,"JPEG") == 0) ||
(LocaleCompare(image_info->magick,"JPG") == 0))
{
char
- quality[MaxTextExtent];
+ quality[MagickPathExtent];
int
status;
/*
Request JPEG quality from user.
*/
- (void) FormatLocaleString(quality,MaxTextExtent,"%.20g",(double)
+ (void) FormatLocaleString(quality,MagickPathExtent,"%.20g",(double)
image->quality);
status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
quality);
(LocaleCompare(image_info->magick,"PS2") == 0))
{
char
- geometry[MaxTextExtent];
+ geometry[MagickPathExtent];
/*
Request page geometry from user.
*/
- (void) CopyMagickString(geometry,PSPageGeometry,MaxTextExtent);
+ (void) CopyMagickString(geometry,PSPageGeometry,MagickPathExtent);
if (LocaleCompare(image_info->magick,"PDF") == 0)
- (void) CopyMagickString(geometry,PSPageGeometry,MaxTextExtent);
+ (void) CopyMagickString(geometry,PSPageGeometry,MagickPathExtent);
if (image_info->page != (char *) NULL)
- (void) CopyMagickString(geometry,image_info->page,MaxTextExtent);
+ (void) CopyMagickString(geometry,image_info->page,MagickPathExtent);
XListBrowserWidget(display,windows,&windows->widget,PageSizes,"Select",
"Select page geometry:",geometry);
if (*geometry != '\0')
save_image=CloneImage(image,0,0,MagickTrue,exception);
if (save_image == (Image *) NULL)
return(MagickFalse);
- (void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
(void) TransformImage(&save_image,windows->image.crop_geometry,geometry,
exception);
/*
Write image.
*/
- (void) CopyMagickString(save_image->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(save_image->filename,filename,MagickPathExtent);
status=WriteImage(image_info,save_image,exception);
if (IfMagickTrue(status) )
image->taint=MagickFalse;
save_image=DestroyImage(save_image);
image_info=DestroyImageInfo(image_info);
XSetCursorState(display,windows,MagickFalse);
- return(IsMagickTrue(status));
+ return(status != 0 ? MagickTrue : MagickFalse);
}
\f
/*
case KeyPress:
{
char
- command[MaxTextExtent];
+ command[MagickPathExtent];
KeySym
key_symbol;
RectangleInfo *crop_info,Image *image)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
int
x,
/*
Display info on cropping rectangle.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %.20gx%.20g%+.20g%+.20g",
+ (void) FormatLocaleString(text,MagickPathExtent," %.20gx%.20g%+.20g%+.20g",
(double) crop_info->width,(double) crop_info->height,(double)
crop_info->x,(double) crop_info->y);
XInfoWidget(display,windows,text);
height=(unsigned int) (scale_factor*crop_info->height+0.5);
if (height == 0)
height=1;
- (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
"%ux%u%+d%+d",width,height,x,y);
}
\f
};
char
- command[MaxTextExtent],
- filename[MaxTextExtent];
+ command[MagickPathExtent],
+ filename[MagickPathExtent];
Image
*tile_image;
*/
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(resource_info->image_info->magick,"MIFF",
- MaxTextExtent);
+ MagickPathExtent);
(void) CopyMagickString(resource_info->image_info->filename,filename,
- MaxTextExtent);
+ MagickPathExtent);
tile_image=ReadImage(resource_info->image_info,exception);
CatchException(exception);
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
break;
for (j=0; j < (int) width; j++)
{
- SetPixelInfoPixel(image,&pixel,s);
+ SetPixelViaPixelInfo(image,&pixel,s);
s+=GetPixelChannels(image);
}
if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
Image *image,const KeySym key_symbol)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
int
x,
/*
Refresh Image window.
*/
- (void) FormatLocaleString(text,MaxTextExtent," %ux%u%+d%+d ",
+ (void) FormatLocaleString(text,MagickPathExtent," %ux%u%+d%+d ",
windows->image.width,windows->image.height,windows->image.x,
windows->image.y);
XInfoWidget(display,windows,text);
i;
static char
- filename[MaxTextExtent] = "\0",
- filenames[MaxTextExtent] = "*";
+ filename[MagickPathExtent] = "\0",
+ filenames[MagickPathExtent] = "*";
XResourceInfo
background_resources;
*/
background_resources=(*resource_info);
background_resources.window_id=AcquireString("");
- (void) FormatLocaleString(background_resources.window_id,MaxTextExtent,
+ (void) FormatLocaleString(background_resources.window_id,MagickPathExtent,
"0x%lx",windows->image.id);
background_resources.backdrop=MagickTrue;
/*
Read each image and convert them to a tile.
*/
- backdrop=IsMagickTrue( (windows->visual_info->klass == TrueColor) ||
- (windows->visual_info->klass == DirectColor) );
+ backdrop=((windows->visual_info->klass == TrueColor) ||
+ (windows->visual_info->klass == DirectColor)) ? MagickTrue : MagickFalse;
read_info=CloneImageInfo(resource_info->image_info);
(void) SetImageOption(read_info,"jpeg:size","120x120");
(void) CloneString(&read_info->size,DefaultTileGeometry);
XCheckRefreshWindows(display,windows);
for (i=0; i < (int) number_files; i++)
{
- (void) CopyMagickString(read_info->filename,filelist[i],MaxTextExtent);
+ (void) CopyMagickString(read_info->filename,filelist[i],MagickPathExtent);
filelist[i]=DestroyString(filelist[i]);
*read_info->magick='\0';
next_image=ReadImage(read_info,exception);
montage_info->pointsize=10;
if (resource_info->font != (char *) NULL)
(void) CloneString(&montage_info->font,resource_info->font);
- (void) CopyMagickString(montage_info->filename,filename,MaxTextExtent);
+ (void) CopyMagickString(montage_info->filename,filename,MagickPathExtent);
montage_image=MontageImageList(read_info,montage_info,GetFirstImageInList(
images),exception);
images=DestroyImageList(images);
XResourceInfo *resource_info,Image *image,ExceptionInfo *exception)
{
char
- geometry[MaxTextExtent],
- visual_type[MaxTextExtent];
+ geometry[MagickPathExtent],
+ visual_type[MagickPathExtent];
int
height,
Determine target window.
*/
assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
+ assert(image->signature == MagickCoreSignature);
if (IfMagickTrue(image->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
resources=(*resource_info);
*/
window_attributes.width=XDisplayWidth(display,XDefaultScreen(display));
window_attributes.height=XDisplayHeight(display,XDefaultScreen(display));
- (void) CopyMagickString(visual_type,"default",MaxTextExtent);
+ (void) CopyMagickString(visual_type,"default",MagickPathExtent);
status=XGetWindowAttributes(display,window_info.id,&window_attributes);
if (status != 0)
- (void) FormatLocaleString(visual_type,MaxTextExtent,"0x%lx",
+ (void) FormatLocaleString(visual_type,MagickPathExtent,"0x%lx",
XVisualIDFromVisual(window_attributes.visual));
if (visual_info == (XVisualInfo *) NULL)
{
(image->rows != window_info.height))
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
image->filename);
- (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%ux%u+0+0>",
window_attributes.width,window_attributes.height);
geometry_info.width=window_info.width;
geometry_info.height=window_info.height;
(*resources.image_geometry != '\0'))
{
char
- default_geometry[MaxTextExtent];
+ default_geometry[MagickPathExtent];
int
flags,
ThrowXWindowFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",image->filename);
size_hints->flags=0L;
- (void) FormatLocaleString(default_geometry,MaxTextExtent,"%dx%d",
+ (void) FormatLocaleString(default_geometry,MagickPathExtent,"%dx%d",
width,height);
flags=XWMGeometry(display,visual_info->screen,resources.image_geometry,
default_geometry,window_info.border_width,size_hints,&window_info.x,
delay=1000*image->delay/MagickMax(image->ticks_per_second,1L);
XDelay(display,delay == 0UL ? 10UL : delay);
(void) XSync(display,MagickFalse);
- return(IsMagickTrue(window_info.id == root_window));
+ return(window_info.id == root_window ? MagickTrue : MagickFalse);
}
\f
/*
};
char
- command[MaxTextExtent],
+ command[MagickPathExtent],
*directory,
- geometry[MaxTextExtent],
- resource_name[MaxTextExtent];
+ geometry[MagickPathExtent],
+ resource_name[MagickPathExtent];
CommandType
command_type;
i;
static char
- working_directory[MaxTextExtent];
+ working_directory[MagickPathExtent];
static XPoint
vid_info;
*manager_hints;
assert(image != (Image **) NULL);
- assert((*image)->signature == MagickSignature);
+ assert((*image)->signature == MagickCoreSignature);
if (IfMagickTrue((*image)->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
display_image=(*image);
status;
if (*working_directory == '\0')
- (void) CopyMagickString(working_directory,".",MaxTextExtent);
+ (void) CopyMagickString(working_directory,".",MagickPathExtent);
status=chdir(working_directory);
if (status == -1)
(void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
title=InterpretImageProperties(resource_info->image_info,display_image,
resource_info->title,exception);
- (void) CopyMagickString(windows->image.name,title,MaxTextExtent);
- (void) CopyMagickString(windows->image.icon_name,title,MaxTextExtent);
+ (void) CopyMagickString(windows->image.name,title,MagickPathExtent);
+ (void) CopyMagickString(windows->image.icon_name,title,MagickPathExtent);
title=DestroyString(title);
}
else
{
char
- filename[MaxTextExtent];
+ filename[MagickPathExtent];
/*
Window name is the base of the filename.
*/
GetPathComponent(display_image->magick_filename,TailPath,filename);
if (display_image->scene == 0)
- (void) FormatLocaleString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MagickPathExtent,
"%s: %s",MagickPackageName,filename);
else
- (void) FormatLocaleString(windows->image.name,MaxTextExtent,
+ (void) FormatLocaleString(windows->image.name,MagickPathExtent,
"%s: %s[scene: %.20g frames: %.20g]",MagickPackageName,filename,
(double) display_image->scene,(double) GetImageListLength(
display_image));
- (void) CopyMagickString(windows->image.icon_name,filename,MaxTextExtent);
+ (void) CopyMagickString(windows->image.icon_name,filename,MagickPathExtent);
}
if (resource_info->immutable)
windows->image.immutable=MagickTrue;
windows->image.use_pixmap=resource_info->use_pixmap;
windows->image.geometry=resource_info->image_geometry;
- (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%ux%u+0+0>!",
XDisplayWidth(display,visual_info->screen),
XDisplayHeight(display,visual_info->screen));
geometry_info.width=display_image->columns;
resource_info,&windows->command);
windows->command.data=MagickMenus;
(void) XCommandWidget(display,windows,CommandMenu,(XEvent *) NULL);
- (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.command",
+ (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.command",
resource_info->client_name);
windows->command.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
*/
XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
resource_info,&windows->widget);
- (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.widget",
+ (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.widget",
resource_info->client_name);
windows->widget.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
resource_info,&windows->magnify);
if (IfMagickFalse(resource_info->use_shared_memory) )
windows->magnify.shared_memory=MagickFalse;
- (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.magnify",
+ (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.magnify",
resource_info->client_name);
windows->magnify.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
- (void) FormatLocaleString(windows->magnify.name,MaxTextExtent,"Magnify %uX",
+ (void) FormatLocaleString(windows->magnify.name,MagickPathExtent,"Magnify %uX",
resource_info->magnify);
if (windows->magnify.cursor != (Cursor) NULL)
(void) XFreeCursor(display,windows->magnify.cursor);
(void) CloneString(&windows->pan.name,"Pan Icon");
windows->pan.width=windows->icon.width;
windows->pan.height=windows->icon.height;
- (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.pan",
+ (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.pan",
resource_info->client_name);
windows->pan.geometry=XGetResourceClass(resource_info->resource_database,
resource_name,"geometry",(char *) NULL);
Redisplay image.
*/
(void) FormatLocaleString(
- resource_info->image_info->filename,MaxTextExtent,
+ resource_info->image_info->filename,MagickPathExtent,
"%s:%s",display_image->magick,
display_image->filename);
nexus=ReadImage(resource_info->image_info,exception);
if (nexus != (Image *) NULL)
- {
- nexus=DestroyImage(nexus);
- *state|=NextImageState | ExitState;
- }
+ *state|=NextImageState | ExitState;
}
delay=display_image->delay/MagickMax(
display_image->ticks_per_second,1L);
}
timestamp=time((time_t *) NULL);
(void) XNextEvent(display,&event);
- if (IfMagickFalse(windows->image.stasis) )
- windows->image.stasis=IsMagickTrue((time((time_t *) NULL)-timestamp) > 0);
- if (IfMagickFalse(windows->magnify.stasis) )
- windows->magnify.stasis=IsMagickTrue((time((time_t *) NULL)-timestamp) > 0);
+ if ((windows->image.stasis == MagickFalse) ||
+ (windows->magnify.stasis == MagickFalse))
+ {
+ if ((time((time_t *) NULL)-timestamp) > 0)
+ {
+ windows->image.stasis=MagickTrue;
+ windows->magnify.stasis=MagickTrue;
+ }
+ }
if (event.xany.window == windows->command.id)
{
/*
id=XCommandWidget(display,windows,CommandMenu,&event);
if (id < 0)
continue;
- (void) CopyMagickString(command,CommandMenu[id],MaxTextExtent);
+ (void) CopyMagickString(command,CommandMenu[id],MagickPathExtent);
command_type=CommandMenus[id];
if (id < MagickMenus)
{
command);
if (entry < 0)
continue;
- (void) CopyMagickString(command,Menus[id][entry],MaxTextExtent);
+ (void) CopyMagickString(command,Menus[id][entry],MagickPathExtent);
command_type=Commands[id][entry];
}
if (command_type != NullCommand)
break;
selection=XInternAtom(display,"DndSelection",MagickFalse);
status=XGetWindowProperty(display,root_window,selection,0L,(long)
- MaxTextExtent,MagickFalse,(Atom) AnyPropertyType,&type,&format,
+ MagickPathExtent,MagickFalse,(Atom) AnyPropertyType,&type,&format,
&length,&after,&data);
if ((status != Success) || (length == 0))
break;
Offix DND.
*/
(void) CopyMagickString(resource_info->image_info->filename,
- (char *) data,MaxTextExtent);
+ (char *) data,MagickPathExtent);
}
else
{
break;
}
(void) CopyMagickString(resource_info->image_info->filename,
- ((char *) data)+5,MaxTextExtent);
+ ((char *) data)+5,MagickPathExtent);
}
nexus=ReadImage(resource_info->image_info,exception);
CatchException(exception);
Display image named by the remote command protocol.
*/
status=XGetWindowProperty(display,event.xproperty.window,
- event.xproperty.atom,0L,(long) MaxTextExtent,MagickFalse,(Atom)
+ event.xproperty.atom,0L,(long) MagickPathExtent,MagickFalse,(Atom)
AnyPropertyType,&type,&format,&length,&after,&data);
if ((status != Success) || (length == 0))
break;
break;
}
(void) CopyMagickString(resource_info->image_info->filename,
- (char *) data,MaxTextExtent);
+ (char *) data,MagickPathExtent);
(void) XFree((void *) data);
nexus=ReadImage(resource_info->image_info,exception);
CatchException(exception);
/*
Change to home directory.
*/
- directory=getcwd(working_directory,MaxTextExtent);
+ directory=getcwd(working_directory,MagickPathExtent);
(void) directory;
{
int
status;
if (*resource_info->home_directory == '\0')
- (void) CopyMagickString(resource_info->home_directory,".",MaxTextExtent);
+ (void) CopyMagickString(resource_info->home_directory,".",MagickPathExtent);
status=chdir(resource_info->home_directory);
if (status == -1)
(void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
Image *image,ExceptionInfo *exception)
{
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
+ assert(image->signature == MagickCoreSignature);
(void) image_info;
if (IfMagickTrue(image->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
const char *window,const char *filename,ExceptionInfo *exception)
{
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(filename != (char *) NULL);
(void) window;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);