assert(image_info->signature == MagickSignature);
assert(images != (Image *) NULL);
assert(images->signature == MagickSignature);
- if (images->debug != MagickFalse)
+ if( IfMagickTrue(images->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
display=XOpenDisplay(image_info->server_name);
if (display == (Display *) NULL)
(void) XSetErrorHandler(XError);
status=XRemoteCommand(display,window,filename);
(void) XCloseDisplay(display);
- return(status != 0 ? MagickTrue : MagickFalse);
+ return(IsMagickTrue(status));
}
\f
/*
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
break;
transparent_pen=pen_number == (MaxNumberPens-2) ? MagickTrue :
MagickFalse;
- if (transparent_pen != MagickFalse)
+ if( IfMagickTrue(transparent_pen) )
break;
if (pen_number == (MaxNumberPens-1))
{
break;
transparent_box=pen_number == (MaxNumberPens-2) ? MagickTrue :
MagickFalse;
- if (transparent_box != MagickFalse)
+ if( IfMagickTrue(transparent_box) )
break;
if (pen_number == (MaxNumberPens-1))
{
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
XGetAnnotateInfo(annotate_info);
annotate_info->x=x;
annotate_info->y=y;
- if ((transparent_box == MagickFalse) && (transparent_pen == MagickFalse))
+ if( IfMagickFalse(transparent_box) && IfMagickFalse(transparent_pen))
annotate_info->stencil=OpaqueStencil;
else
- if (transparent_box == MagickFalse)
+ if( IfMagickFalse(transparent_box) )
annotate_info->stencil=BackgroundStencil;
else
annotate_info->stencil=ForegroundStencil;
XCheckRefreshWindows(display,windows);
background_resources=(*resource_info);
background_resources.window_id=window_id;
- background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse;
+ background_resources.backdrop=IsMagickTrue(status);
status=XDisplayBackgroundImage(display,&background_resources,*image,
exception);
- if (status != MagickFalse)
+ if (IfMagickTrue(status))
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_retain_colors,CurrentTime);
XSetCursorState(display,windows,MagickFalse);
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
/*
Display info and draw chopping line.
*/
- if (windows->info.mapped == MagickFalse)
+ if( IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
(void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) chop_info.width,(double)
windows->image.highlight_context,&segment_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
/*
Wait for next event.
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
/*
Update color information using point algorithm.
*/
- if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+ if( IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
return(MagickFalse);
q=GetCacheViewAuthenticPixels(image_view,(ssize_t)x_offset,
(ssize_t) y_offset,1,1,exception);
}
q+=GetPixelChannels(*image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
}
(DrawInfo *) NULL);
(void) QueryColorCompliance(resource_info->pen_colors[pen_id],
AllCompliance,&draw_info->fill,exception);
- (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
- x_offset,(ssize_t) y_offset,method == FloodfillMethod ?
- MagickFalse : MagickTrue,exception);
+ (void) FloodfillPaintImage(*image,draw_info,&target,
+ (ssize_t)x_offset,(ssize_t)y_offset,
+ IsMagickFalse(method == FloodfillMethod),exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
/*
Update color information using reset algorithm.
*/
- if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+ if( IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
return(MagickFalse);
for (y=0; y < (int) (*image)->rows; y++)
{
SetPixelBlue(*image,ScaleShortToQuantum(color.blue),q);
q+=GetPixelChannels(*image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
break;
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
{
case ButtonPress:
{
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
event.xbutton.button,event.xbutton.x,event.xbutton.y);
}
case ButtonRelease:
{
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
event.xbutton.button,event.xbutton.x,event.xbutton.y);
length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
sizeof(command),&key_symbol,(XComposeStatus *) NULL);
*(command+length)='\0';
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Key press: 0x%lx (%s)",(unsigned long) key_symbol,command);
switch ((int) key_symbol)
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
}
default:
{
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
event.type);
break;
(void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel,exception);
opacity=(Quantum) (ScaleQuantumToChar(QuantumRange)-
((ssize_t) ScaleQuantumToChar(QuantumRange)*blend)/100);
- if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
+ if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
return(MagickFalse);
image->alpha_trait=BlendPixelTrait;
image_view=AcquireAuthenticCacheView(image,exception);
SetPixelAlpha(image,opacity,q);
q+=GetPixelChannels(image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
image_view=DestroyCacheView(image_view);
*/
width=(unsigned int) windows->image.window_changes.width;
height=(unsigned int) windows->image.window_changes.height;
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Configure Image: %dx%d=>%.20gx%.20g",windows->image.ximage->width,
windows->image.ximage->height,(double) width,(double) height);
(height*windows->image.y/windows->image.ximage->height);
status=XMakeImage(display,resource_info,&windows->image,image,
(unsigned int) width,(unsigned int) height,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to configure X image:",
windows->image.name);
/*
/*
Update Magnify window configuration.
*/
- if (windows->magnify.mapped != MagickFalse)
+ if( IfMagickTrue(windows->magnify.mapped) )
XMakeMagnifyImage(display,windows,exception);
windows->pan.crop_geometry=windows->image.crop_geometry;
XBestIconSize(display,&windows->pan,image);
(void) XReconfigureWMWindow(display,windows->icon.id,windows->icon.screen,
(unsigned int) (CWWidth | CWHeight),&window_changes);
XSetCursorState(display,windows,MagickFalse);
- return(status != 0 ? MagickTrue : MagickFalse);
+ return(IsMagickTrue(status));
}
\f
/*
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
/*
Display info and draw cropping rectangle.
*/
- if (windows->info.mapped == MagickFalse)
+ if( IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
(void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
windows->image.highlight_context,&highlight_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
/*
Wait for next event.
(void) XMapWindow(display,windows->info.id);
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
/*
Cut image.
*/
- if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
+ if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
return(MagickFalse);
image->alpha_trait=BlendPixelTrait;
image_view=AcquireAuthenticCacheView(image,exception);
SetPixelAlpha(image,TransparentAlpha,q);
q+=GetPixelChannels(image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
image_view=DestroyCacheView(image_view);
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
break;
transparent=pen_number == (MaxNumberPens-2) ? MagickTrue :
MagickFalse;
- if (transparent != MagickFalse)
+ if( IfMagickTrue(transparent) )
{
draw_info.stencil=TransparentStencil;
break;
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
windows->image.highlight_context,&line_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
break;
windows->image.highlight_context,&rectangle_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
break;
windows->image.highlight_context,&rectangle_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
break;
windows->image.highlight_context,&line_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
break;
}
XSetCursorState(display,windows,MagickFalse);
coordinate_info=(XPoint *) RelinquishMagickMemory(coordinate_info);
- return(status != 0 ? MagickTrue : MagickFalse);
+ return(IsMagickTrue(status));
}
\f
/*
redo_image=(*image);
*image=cache_image->list;
cache_image=DestroyImage(cache_image);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
return;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
*image=DestroyImage(*image);
*image=redo_image;
redo_image=NewImageList();
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
return;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
Save image.
*/
status=XSaveImage(display,resource_info,windows,*image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
char
message[MaxTextExtent];
Print image.
*/
status=XPrintImage(display,resource_info,windows,*image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
char
message[MaxTextExtent];
XFileBrowserWidget(display,windows,"Delete",filename);
if (*filename == '\0')
break;
- status=remove_utf8(filename) != 0 ? MagickTrue : MagickFalse;
- if (status != MagickFalse)
+ status=IsMagickTrue(remove_utf8(filename));
+ if( IfMagickTrue(status) )
XNoticeWidget(display,windows,"Unable to delete image file:",filename);
break;
}
/*
exit program.
*/
- if (resource_info->confirm_exit == MagickFalse)
+ if( IfMagickFalse(resource_info->confirm_exit) )
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_exit,CurrentTime);
else
Paste image.
*/
status=XPasteImage(display,resource_info,windows,*image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to paste X image",
(*image)->filename);
Chop image.
*/
status=XChopImage(display,resource_info,windows,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to cut X image",
(*image)->filename);
(void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",width,height,(int) (*image)->columns-(int) width-x,y);
}
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
(void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
(void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
"%ux%u%+d%+d",width,height,x,(int) (*image)->rows-(int) height-y);
}
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
(void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
Rotate image 90 degrees clockwise.
*/
status=XRotateImage(display,resource_info,windows,90.0,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to rotate X image",
(*image)->filename);
Rotate image 90 degrees counter-clockwise.
*/
status=XRotateImage(display,resource_info,windows,-90.0,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to rotate X image",
(*image)->filename);
Rotate image.
*/
status=XRotateImage(display,resource_info,windows,0.0,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to rotate X image",
(*image)->filename);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
Trim image.
*/
status=XTrimImage(display,resource_info,windows,*image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to trim X image",
(*image)->filename);
MaxTextExtent);
(void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
MaxTextExtent);
(void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
MaxTextExtent);
(void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
XCheckRefreshWindows(display,windows);
(void) GammaImage(*image,atof(factor),exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
XCheckRefreshWindows(display,windows);
(void) ContrastImage(*image,MagickTrue,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
XCheckRefreshWindows(display,windows);
(void) ContrastImage(*image,MagickFalse,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
(void) ContrastStretchImage(*image,black_point,white_point,
exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
(void) SigmoidalContrastImage(*image,MagickTrue,geometry_info.rho,
geometry_info.sigma,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
XCheckRefreshWindows(display,windows);
(void) NormalizeImage(*image,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
XCheckRefreshWindows(display,windows);
(void) EqualizeImage(*image,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
XCheckRefreshWindows(display,windows);
(void) NegateImage(*image,MagickFalse,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
(void) SetImageType(*image,(*image)->alpha_trait != BlendPixelTrait ?
GrayscaleType : GrayscaleMatteType,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
NoDitherMethod;
(void) QuantizeImage(&quantize_info,*image,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
(void) BilevelImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
flags=ParseGeometry(geometry,&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
- shade_image=ShadeImage(*image,status != 0 ? MagickFalse : MagickTrue,
+ shade_image=ShadeImage(*image,IsMagickTrue(status),
geometry_info.rho,geometry_info.sigma,exception);
if (shade_image != (Image *) NULL)
{
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
exception);
(void) RaiseImage(*image,&page_geometry,MagickTrue,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
(void) SegmentImage(*image,sRGBColorspace,MagickFalse,geometry_info.rho,
geometry_info.sigma,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
(void) SolarizeImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
XConfigureImageColormap(display,resource_info,windows,*image,exception);
(void) XConfigureImage(display,resource_info,windows,*image,exception);
Annotate the image with text.
*/
status=XAnnotateEditImage(display,resource_info,windows,*image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to annotate X image",
(*image)->filename);
Draw image.
*/
status=XDrawEditImage(display,resource_info,windows,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to draw on the X image",
(*image)->filename);
Color edit.
*/
status=XColorEditImage(display,resource_info,windows,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to pixel edit X image",
(*image)->filename);
Matte edit.
*/
status=XMatteEditImage(display,resource_info,windows,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to matte edit X image",
(*image)->filename);
*/
status=XCompositeImage(display,resource_info,windows,*image,
exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
{
XNoticeWidget(display,windows,"Unable to composite X image",
(*image)->filename);
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
}
CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
XCheckRefreshWindows(display,windows);
status=InvokeDelegate(image_info,*image,"edit",(char *) NULL,
exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to edit image comment",
(char *) NULL);
else
(void) FormatLocaleString((*image)->filename,MaxTextExtent,"launch:%s",
filename);
status=WriteImage(image_info,*image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to launch image editor",
(char *) NULL);
else
/*
Zoom image.
*/
- if (windows->magnify.mapped != MagickFalse)
+ if( IfMagickTrue(windows->magnify.mapped) )
(void) XRaiseWindow(display,windows->magnify.id);
else
{
filename);
status=WriteImage(image_info,preview_image,exception);
preview_image=DestroyImage(preview_image);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to show image preview",
(*image)->filename);
XDelay(display,1500);
"show:%s",filename);
status=WriteImage(image_info,histogram_image,exception);
histogram_image=DestroyImage(histogram_image);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to show histogram",
(*image)->filename);
XDelay(display,1500);
filename);
status=WriteImage(image_info,matte_image,exception);
matte_image=DestroyImage(matte_image);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to show matte",
(*image)->filename);
XDelay(display,1500);
Background image.
*/
status=XBackgroundImage(display,resource_info,windows,image,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
break;
nexus=CloneImage(*image,0,0,MagickTrue,exception);
if (nexus != (Image *) NULL)
Set user preferences.
*/
status=XPreferencesWidget(display,resource_info,windows);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
break;
nexus=CloneImage(*image,0,0,MagickTrue,exception);
if (nexus != (Image *) NULL)
XCheckRefreshWindows(display,windows);
status=InvokeDelegate(image_info,*image,"browse",(char *) NULL,
exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
XNoticeWidget(display,windows,"Unable to browse documentation",
(char *) NULL);
XDelay(display,1500);
/*
Map and unmap Info widget as text cursor crosses its boundaries.
*/
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
if ((x > (int) (windows->info.x+windows->info.width)) ||
(y > (int) (windows->info.y+windows->info.height)))
(void) XMapWindow(display,windows->info.id);
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
windows->pan.y=(int) windows->image.y;
status=XMakeImage(display,resource_info,&windows->pan,image,
windows->pan.width,windows->pan.height,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
ThrowXWindowFatalException(ResourceLimitError,
"MemoryAllocationFailed",image->filename);
(void) XSetWindowBackgroundPixmap(display,windows->pan.id,
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
if ((x_offset >= (int) (*image)->columns) ||
(y_offset >= (int) (*image)->rows))
continue;
- if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+ if( IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
return(MagickFalse);
if ((*image)->alpha_trait != BlendPixelTrait)
(void) SetImageAlphaChannel(*image,OpaqueAlphaChannel,exception);
SetPixelAlpha(*image,(Quantum) StringToLong(matte),q);
q+=GetPixelChannels(*image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
break;
StringToDouble(matte,(char **) NULL));
channel_mask=SetImageChannelMask(*image,AlphaChannel);
(void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
- x_offset,(ssize_t) y_offset,method == FloodfillMethod ?
- MagickFalse : MagickTrue,exception);
+ x_offset,(ssize_t) y_offset,
+ IsMagickFalse(method == FloodfillMethod),exception);
(void) SetPixelChannelMask(*image,channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
/*
Update matte information using reset algorithm.
*/
- if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+ if( IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
return(MagickFalse);
for (y=0; y < (int) (*image)->rows; y++)
{
SetPixelAlpha(*image,(Quantum) StringToLong(matte),q);
q+=GetPixelChannels(*image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
if (StringToLong(matte) == (long) OpaqueAlpha)
/*
Request file name from user.
*/
- if (command == MagickFalse)
+ if( IfMagickFalse(command) )
XFileBrowserWidget(display,windows,"Open",filename);
else
{
}
magick_info=GetMagickInfo(image_info->magick,exception);
if ((magick_info != (const MagickInfo *) NULL) &&
- (magick_info->raw != MagickFalse))
+ IfMagickTrue(magick_info->raw))
{
char
geometry[MaxTextExtent];
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
{
case ButtonPress:
{
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
event.xbutton.button,event.xbutton.x,event.xbutton.y);
}
case ButtonRelease:
{
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
event.xbutton.button,event.xbutton.x,event.xbutton.y);
length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
sizeof(command),&key_symbol,(XComposeStatus *) NULL);
*(command+length)='\0';
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Key press: 0x%lx (%s)",(long) key_symbol,command);
switch ((int) key_symbol)
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
}
default:
{
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
event.type);
break;
print_image=DestroyImage(print_image);
image_info=DestroyImageInfo(image_info);
XSetCursorState(display,windows,MagickFalse);
- return(status != 0 ? MagickTrue : MagickFalse);
+ return(IsMagickTrue(status));
}
\f
/*
state=DefaultState;
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
/*
Display info and draw region of interest rectangle.
*/
- if (windows->info.mapped == MagickFalse)
+ if( IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
(void) FormatLocaleString(text,MaxTextExtent,
" %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
windows->image.highlight_context,&highlight_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
/*
Wait for next event.
(void) XMapWindow(display,windows->info.id);
do
{
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display pointer position.
*/
x=event.xmotion.x;
y=event.xmotion.y;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
if ((x < (int) (windows->info.x+windows->info.width)) &&
(y < (int) (windows->info.y+windows->info.height)))
/*
Display info and draw rotation line.
*/
- if (windows->info.mapped == MagickFalse)
+ if( IfMagickFalse(windows->info.mapped) )
(void) XMapWindow(display,windows->info.id);
(void) FormatLocaleString(text,MaxTextExtent," %g",
direction == VerticalRotateCommand ? degrees-90.0 : degrees);
windows->image.highlight_context,&rotate_info);
}
else
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
/*
}
}
}
- if (windows->image.orphan != MagickFalse)
+ if( IfMagickTrue(windows->image.orphan) )
return(MagickTrue);
if (normalized_degrees != 0.0)
{
XFileBrowserWidget(display,windows,"Save",filename);
if (*filename == '\0')
return(MagickTrue);
- if (IsPathAccessible(filename) != MagickFalse)
+ if( IfMagickTrue(IsPathAccessible(filename)) )
{
int
status;
*/
(void) CopyMagickString(save_image->filename,filename,MaxTextExtent);
status=WriteImage(image_info,save_image,exception);
- if (status != MagickFalse)
+ if( IfMagickTrue(status) )
image->taint=MagickFalse;
save_image=DestroyImage(save_image);
image_info=DestroyImageInfo(image_info);
XSetCursorState(display,windows,MagickFalse);
- return(status != 0 ? MagickTrue : MagickFalse);
+ return(IsMagickTrue(status));
}
\f
/*
if (y >= (int) windows->image.height)
y=(int) (windows->image.height-1);
windows->magnify.y=windows->image.y+y;
- if (windows->magnify.mapped == MagickFalse)
+ if( IfMagickFalse(windows->magnify.mapped) )
(void) XMapRaised(display,windows->magnify.id);
XMakeMagnifyImage(display,windows,exception);
if (event->type == ButtonRelease)
*/
windows->magnify.width=(unsigned int) event->xconfigure.width;
windows->magnify.height=(unsigned int) event->xconfigure.height;
- if (windows->magnify.mapped == MagickFalse)
+ if( IfMagickFalse(windows->magnify.mapped) )
break;
magnify=1;
while ((int) magnify <= event->xconfigure.width)
{
while (XCheckMaskEvent(display,ButtonMotionMask,event)) ;
if (event->xmotion.window == windows->image.id)
- if (windows->magnify.mapped != MagickFalse)
+ if( IfMagickTrue(windows->magnify.mapped) )
{
/*
Update magnified image.
height,
width;
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
{
/*
Display info on cropping rectangle.
/*
Delete tile image.
*/
- if (IsPathAccessible(filename) == MagickFalse)
+ if( IfMagickFalse(IsPathAccessible(filename)) )
{
XNoticeWidget(display,windows,"Image file does not exist:",filename);
break;
status=XConfirmWidget(display,windows,"Really delete tile",filename);
if (status <= 0)
break;
- status=remove_utf8(filename) != 0 ? MagickTrue : MagickFalse;
- if (status != MagickFalse)
+ status=IsMagickTrue(remove_utf8(filename));
+ if( IfMagickTrue(status) )
{
XNoticeWidget(display,windows,"Unable to delete image file:",
filename);
q++;
(void) CopyMagickString(filename,p,(size_t) (q-p+1));
p=q;
- if (IsPathAccessible(filename) != MagickFalse)
+ if( IfMagickTrue(IsPathAccessible(filename)) )
{
tile++;
continue;
SetPixelInfoPixel(image,&pixel,s);
s+=GetPixelChannels(image);
}
- if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
break;
}
image_view=DestroyCacheView(image_view);
number_files=1;
filelist[0]=filenames;
status=ExpandFilenames(&number_files,&filelist);
- if ((status == MagickFalse) || (number_files == 0))
+ if( IfMagickFalse(status) || (number_files == 0))
{
if (number_files == 0)
ThrowXWindowFatalException(ImageError,"NoImagesWereFound",filenames)
/*
Read each image and convert them to a tile.
*/
- backdrop=(windows->visual_info->klass == TrueColor) ||
- (windows->visual_info->klass == DirectColor) ? MagickTrue : MagickFalse;
+ backdrop=IsMagickTrue( (windows->visual_info->klass == TrueColor) ||
+ (windows->visual_info->klass == DirectColor) );
read_info=CloneImageInfo(resource_info->image_info);
(void) SetImageOption(read_info,"jpeg:size","120x120");
(void) CloneString(&read_info->size,DefaultTileGeometry);
proceed=SetImageProgress(images,LoadImageTag,(MagickOffsetType) i,
(MagickSizeType) number_files);
- if (proceed == MagickFalse)
+ if( IfMagickFalse(proceed) )
break;
}
}
*/
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
resources=(*resource_info);
window_info.id=(Window) NULL;
window_info.y=(int) geometry_info.y;
status=XMakeImage(display,&resources,&window_info,image,window_info.width,
window_info.height,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
image->filename);
window_info.x=0;
window_info.y=0;
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
{
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Image: %s[%.20g] %.20gx%.20g ",image->filename,(double) image->scene,
*/
width=(int) window_info.width;
height=(int) window_info.height;
- if (resources.backdrop != MagickFalse)
+ if( IfMagickTrue(resources.backdrop) )
{
/*
Center image on window.
delay=1000*image->delay/MagickMax(image->ticks_per_second,1L);
XDelay(display,delay == 0UL ? 10UL : delay);
(void) XSync(display,MagickFalse);
- return(window_info.id == root_window ? MagickTrue : MagickFalse);
+ return(IsMagickTrue(window_info.id == root_window));
}
\f
/*
assert(image != (Image **) NULL);
assert((*image)->signature == MagickSignature);
- if ((*image)->debug != MagickFalse)
+ if( IfMagickTrue((*image)->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
display_image=(*image);
warning_handler=(WarningHandler) NULL;
manager_hints=windows->manager_hints;
root_window=XRootWindow(display,visual_info->screen);
nexus=NewImageList();
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
{
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Image: %s[%.20g] %.20gx%.20g ",display_image->filename,
manager_hints->initial_state=WithdrawnState;
XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
&windows->context);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (context)",windows->context.id);
context_values.background=pixel->background_color.pixel;
manager_hints->initial_state=IconicState;
XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
&windows->icon);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (icon)",
windows->icon.id);
/*
XGetWindowInfo(display,visual_info,map_info,pixel,font_info,resource_info,
&windows->image);
windows->image.shape=MagickTrue; /* non-rectangular shape hint */
- if (resource_info->use_shared_memory == MagickFalse)
+ if( IfMagickFalse(resource_info->use_shared_memory) )
windows->image.shared_memory=MagickFalse;
if ((resource_info->title != (char *) NULL) && !(*state & MontageImageState))
{
NormalState;
XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
&windows->backdrop);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (backdrop)",windows->backdrop.id);
(void) XMapWindow(display,windows->backdrop.id);
manager_hints->flags|=WindowGroupHint;
manager_hints->window_group=windows->group_leader.id;
(void) XSelectInput(display,windows->group_leader.id,StructureNotifyMask);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (group leader)",windows->group_leader.id);
}
if (windows->group_leader.id != (Window) NULL)
(void) XSetTransientForHint(display,windows->image.id,
windows->group_leader.id);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (image)",
windows->image.id);
/*
windows->info.shadow_stipple=XCreateBitmapFromData(display,
windows->info.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
(void) XSetTransientForHint(display,windows->info.id,windows->image.id);
- if (windows->image.mapped != MagickFalse)
+ if( IfMagickTrue(windows->image.mapped) )
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (info)",
windows->info.id);
/*
windows->command.shadow_stipple=XCreateBitmapFromData(display,
windows->command.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
(void) XSetTransientForHint(display,windows->command.id,windows->image.id);
- if (windows->command.mapped != MagickFalse)
+ if( IfMagickTrue(windows->command.mapped) )
(void) XMapRaised(display,windows->command.id);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (command)",windows->command.id);
/*
windows->widget.shadow_stipple=XCreateBitmapFromData(display,
windows->widget.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
(void) XSetTransientForHint(display,windows->widget.id,windows->image.id);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (widget)",windows->widget.id);
/*
windows->popup.shadow_stipple=XCreateBitmapFromData(display,
windows->popup.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
(void) XSetTransientForHint(display,windows->popup.id,windows->image.id);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (pop up)",windows->popup.id);
/*
*/
XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
resource_info,&windows->magnify);
- if (resource_info->use_shared_memory == MagickFalse)
+ if( IfMagickFalse(resource_info->use_shared_memory) )
windows->magnify.shared_memory=MagickFalse;
(void) FormatLocaleString(resource_name,MaxTextExtent,"%s.magnify",
resource_info->client_name);
manager_hints->window_group=windows->image.id;
XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
&windows->magnify);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Window id: 0x%lx (magnify)",windows->magnify.id);
(void) XSetTransientForHint(display,windows->magnify.id,windows->image.id);
manager_hints->window_group=windows->image.id;
XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
&windows->pan);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (pan)",
windows->pan.id);
(void) XSetTransientForHint(display,windows->pan.id,windows->image.id);
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
- if ((windows->image.mapped == MagickFalse) ||
+ if( IfMagickFalse(windows->image.mapped) ||
(windows->backdrop.id != (Window) NULL))
(void) XMapWindow(display,windows->image.id);
/*
display_image->filename);
status=XMakeImage(display,resource_info,&windows->image,display_image,
width,height,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
display_image->filename);
status=XMakeImage(display,resource_info,&windows->magnify,(Image *) NULL,
windows->magnify.width,windows->magnify.height,exception);
- if (status == MagickFalse)
+ if( IfMagickFalse(status) )
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
display_image->filename);
- if (windows->magnify.mapped != MagickFalse)
+ if( IfMagickTrue(windows->magnify.mapped) )
(void) XMapRaised(display,windows->magnify.id);
- if (windows->pan.mapped != MagickFalse)
+ if( IfMagickTrue(windows->pan.mapped) )
(void) XMapRaised(display,windows->pan.id);
windows->image.window_changes.width=(int) display_image->columns;
windows->image.window_changes.height=(int) display_image->rows;
delay=display_image->delay/MagickMax(display_image->ticks_per_second,1L);
timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1;
update_time=0;
- if (resource_info->update != MagickFalse)
+ if( IfMagickTrue(resource_info->update) )
{
MagickBooleanType
status;
Determine when file data was last modified.
*/
status=GetPathAttributes(display_image->filename,&attributes);
- if (status != MagickFalse)
+ if( IfMagickTrue(status) )
update_time=attributes.st_mtime;
}
*state&=(~FormerImageState);
/*
Handle a window event.
*/
- if (windows->image.mapped != MagickFalse)
+ if( IfMagickTrue(windows->image.mapped) )
if ((display_image->delay != 0) || (resource_info->update != 0))
{
if (timer < time((time_t *) NULL))
{
- if (resource_info->update == MagickFalse)
+ if( IfMagickFalse(resource_info->update) )
*state|=NextImageState | ExitState;
else
{
Determine if image file was modified.
*/
status=GetPathAttributes(display_image->filename,&attributes);
- if (status != MagickFalse)
+ if( IfMagickTrue(status) )
if (update_time != attributes.st_mtime)
{
/*
}
timestamp=time((time_t *) NULL);
(void) XNextEvent(display,&event);
- if (windows->image.stasis == MagickFalse)
- windows->image.stasis=(time((time_t *) NULL)-timestamp) > 0 ?
- MagickTrue : MagickFalse;
- if (windows->magnify.stasis == MagickFalse)
- windows->magnify.stasis=(time((time_t *) NULL)-timestamp) > 0 ?
- MagickTrue : MagickFalse;
+ 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 (event.xany.window == windows->command.id)
{
/*
{
case ButtonPress:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
event.xbutton.button,event.xbutton.x,event.xbutton.y);
/*
Map/unmap Command widget.
*/
- if (windows->command.mapped != MagickFalse)
+ if( IfMagickTrue(windows->command.mapped) )
(void) XWithdrawWindow(display,windows->command.id,
windows->command.screen);
else
}
case ButtonRelease:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
event.xbutton.button,event.xbutton.x,event.xbutton.y);
}
case ClientMessage:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Client Message: 0x%lx 0x%lx %d 0x%lx",event.xclient.window,
event.xclient.message_type,event.xclient.format,(unsigned long)
(unsigned long) magick_windows[i]->mask,
&magick_windows[i]->attributes);
}
- if (windows->pan.mapped != MagickFalse)
+ if( IfMagickTrue(windows->pan.mapped) )
{
(void) XSetWindowBackgroundPixmap(display,windows->pan.id,
windows->pan.pixmap);
}
case ConfigureNotify:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Configure Notify: 0x%lx %dx%d+%d+%d %d",event.xconfigure.window,
event.xconfigure.width,event.xconfigure.height,event.xconfigure.x,
Position the transient windows relative of the Image window.
*/
if (windows->command.geometry == (char *) NULL)
- if (windows->command.mapped == MagickFalse)
+ if( IfMagickFalse(windows->command.mapped) )
{
windows->command.x=event.xconfigure.x-
windows->command.width-25;
&window_changes);
}
if (windows->widget.geometry == (char *) NULL)
- if (windows->widget.mapped == MagickFalse)
+ if( IfMagickFalse(windows->widget.mapped) )
{
windows->widget.x=event.xconfigure.x+
event.xconfigure.width/10;
&window_changes);
}
if (windows->magnify.geometry == (char *) NULL)
- if (windows->magnify.mapped == MagickFalse)
+ if( IfMagickFalse(windows->magnify.mapped) )
{
windows->magnify.x=event.xconfigure.x+
event.xconfigure.width+25;
&window_changes);
}
if (windows->pan.geometry == (char *) NULL)
- if (windows->pan.mapped == MagickFalse)
+ if( IfMagickFalse(windows->pan.mapped) )
{
windows->pan.x=event.xconfigure.x+
event.xconfigure.width+25;
windows->image.x=vid_info.x;
windows->image.y=vid_info.y;
}
- if ((windows->image.mapped != MagickFalse) &&
- (windows->image.stasis != MagickFalse))
+ if( IfMagickTrue(windows->image.mapped) &&
+ IfMagickTrue(windows->image.stasis) )
{
/*
Update image window configuration.
XDrawPanRectangle(display,windows);
}
else
- if (windows->pan.mapped != MagickFalse)
+ if( IfMagickTrue(windows->pan.mapped) )
(void) XWithdrawWindow(display,windows->pan.id,
windows->pan.screen);
break;
*/
windows->magnify.width=(unsigned int) event.xconfigure.width;
windows->magnify.height=(unsigned int) event.xconfigure.height;
- if (windows->magnify.mapped == MagickFalse)
+ if( IfMagickFalse(windows->magnify.mapped) )
break;
magnify=1;
while ((int) magnify <= event.xconfigure.width)
&window_changes);
break;
}
- if ((windows->magnify.mapped != MagickFalse) &&
- (windows->magnify.stasis != MagickFalse))
+ if( IfMagickTrue(windows->magnify.mapped) &&
+ IfMagickTrue(windows->magnify.stasis) )
{
status=XMakeImage(display,resource_info,&windows->magnify,
display_image,windows->magnify.width,windows->magnify.height,
}
break;
}
- if ((windows->magnify.mapped != MagickFalse) &&
+ if( IfMagickTrue(windows->magnify.mapped) &&
(event.xconfigure.window == windows->pan.id))
{
/*
/*
Group leader has exited.
*/
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Destroy Notify: 0x%lx",event.xdestroywindow.window);
if (event.xdestroywindow.window == windows->group_leader.id)
}
case Expose:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Expose: 0x%lx %dx%d+%d+%d",event.xexpose.window,
event.xexpose.width,event.xexpose.height,event.xexpose.x,
Refresh windows that are now exposed.
*/
if ((event.xexpose.window == windows->image.id) &&
- (windows->image.mapped != MagickFalse))
+ IfMagickTrue(windows->image.mapped) )
{
XRefreshWindow(display,&windows->image,&event);
delay=display_image->delay/MagickMax(
break;
}
if ((event.xexpose.window == windows->magnify.id) &&
- (windows->magnify.mapped != MagickFalse))
+ IfMagickTrue(windows->magnify.mapped))
{
XMakeMagnifyImage(display,windows,exception);
break;
length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
sizeof(command),&key_symbol,(XComposeStatus *) NULL);
*(command+length)='\0';
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Key press: %d 0x%lx (%s)",event.xkey.state,(unsigned long)
key_symbol,command);
*/
(void) XLookupString((XKeyEvent *) &event.xkey,command,(int)
sizeof(command),&key_symbol,(XComposeStatus *) NULL);
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Key release: 0x%lx (%c)",(unsigned long) key_symbol,*command);
break;
}
case MapNotify:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Map Notify: 0x%lx",
event.xmap.window);
if (event.xmap.window == windows->backdrop.id)
after,
length;
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Property Notify: 0x%lx 0x%lx %d",event.xproperty.window,
event.xproperty.atom,event.xproperty.state);
}
case ReparentNotify:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Reparent Notify: 0x%lx=>0x%lx",event.xreparent.parent,
event.xreparent.window);
}
case UnmapNotify:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),
"Unmap Notify: 0x%lx",event.xunmap.window);
if (event.xunmap.window == windows->backdrop.id)
}
default:
{
- if (display_image->debug != MagickFalse)
+ if( IfMagickTrue(display_image->debug) )
(void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
event.type);
break;
(void) XMagickCommand(display,resource_info,windows,FreeBuffersCommand,
&display_image,exception);
else
- if (resource_info->confirm_edit != MagickFalse)
+ if( IfMagickTrue(resource_info->confirm_edit) )
{
/*
Query user if image has changed.
*/
- if ((resource_info->immutable == MagickFalse) &&
- (display_image->taint != MagickFalse))
+ if( IfMagickFalse(resource_info->immutable) &&
+ IfMagickTrue(display_image->taint))
{
int
status;
/*
Withdraw pan and Magnify window.
*/
- if (windows->info.mapped != MagickFalse)
+ if( IfMagickTrue(windows->info.mapped) )
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
- if (windows->magnify.mapped != MagickFalse)
+ if( IfMagickTrue(windows->magnify.mapped) )
(void) XWithdrawWindow(display,windows->magnify.id,
windows->magnify.screen);
- if (windows->command.mapped != MagickFalse)
+ if( IfMagickTrue(windows->command.mapped) )
(void) XWithdrawWindow(display,windows->command.id,
windows->command.screen);
}
- if (windows->pan.mapped != MagickFalse)
+ if( IfMagickTrue(windows->pan.mapped) )
(void) XWithdrawWindow(display,windows->pan.id,windows->pan.screen);
- if (resource_info->backdrop == MagickFalse)
+ if( IfMagickFalse(resource_info->backdrop) )
if (windows->backdrop.mapped)
{
(void) XWithdrawWindow(display,windows->backdrop.id,
assert(image_info->signature == MagickSignature);
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
- if (image->debug != MagickFalse)
+ if( IfMagickTrue(image->debug) )
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
(void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
"DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image->filename);