diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 746907363..a01b0a202 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -3,11 +3,11 @@ * * Contains the Mac implementation of the common dialog boxes. * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2017 Christian Gollwitzer - * Copyright (c) 2022 Marc Culler + * Copyright © 1996-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009, Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2017 Christian Gollwitzer + * Copyright © 2022 Marc Culler * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 726d8b9ad..01c0b1b34 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -4,10 +4,10 @@ * The code in this file provides an interface for XImages, and * implements the nsimage image type. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2017-2021 Marc Culler. + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009, Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2017-2021 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -502,6 +502,9 @@ TkMacOSXPutImage( MacDrawable *macDraw = (MacDrawable *)drawable; int result = Success; + if (width <= 0 || height <= 0) { + return Success; /* Is OK. Nothing to see here, literally. */ + } LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(drawable, gc, &dc)) { return BadDrawable; @@ -623,7 +626,7 @@ int TkpPutRGBAImage( *---------------------------------------------------------------------- */ -CGImageRef +static CGImageRef CreateCGImageFromDrawableRect( Drawable drawable, int x, @@ -736,7 +739,7 @@ CreatePDFFromDrawableRect( *---------------------------------------------------------------------- */ -CGImageRef +static CGImageRef CreateCGImageFromPixmap( Drawable pixmap) { @@ -1096,12 +1099,12 @@ struct TkMacOSXNSImageModel { int radius; /* Radius for rounded corners. */ int ring; /* Thickness of the focus ring. */ double alpha; /* Transparency, between 0.0 and 1.0*/ - bool pressed; /* Image is for use in a pressed button.*/ - bool templ; /* Image is for use as a template.*/ char *imageName ; /* Malloc'ed image name. */ char *source; /* Malloc'ed string describing the image. */ char *as; /* Malloc'ed interpretation of source */ int flags; /* Sundry flags, defined below. */ + bool pressed; /* Image is for use in a pressed button.*/ + bool templ; /* Image is for use as a template.*/ TkMacOSXNSImageInstance *instancePtr; /* Start of list of instances associated * with this model. */ NSImage *image; /* The underlying NSImage object. */ diff --git a/macosx/tkMacOSXImage.h b/macosx/tkMacOSXImage.h index 7dcb50e2e..277683fd2 100644 --- a/macosx/tkMacOSXImage.h +++ b/macosx/tkMacOSXImage.h @@ -18,8 +18,5 @@ * Function prototypes */ -CGImageRef CreateCGImageFromPixmap(Drawable pixmap); -CGImageRef CreateCGImageFromDrawableRect( Drawable drawable, - int x, int y, unsigned int width, unsigned int height); -CFDataRef CreatePDFFromDrawableRect( Drawable drawable, +MODULE_SCOPE CFDataRef CreatePDFFromDrawableRect( Drawable drawable, int x, int y, unsigned int width, unsigned int height); diff --git a/macosx/tkMacOSXPrint.c b/macosx/tkMacOSXPrint.c index 9797bfa62..ee30e1ff9 100644 --- a/macosx/tkMacOSXPrint.c +++ b/macosx/tkMacOSXPrint.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include "tkMacOSXImage.h" #include "tkMacOSXPrivate.h" NSString * fileName = nil; diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index f651c06a4..e3afc4730 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -3,12 +3,12 @@ * * Tk theme engine for Mac OSX, using the Appearance Manager API. * - * Copyright (c) 2004 Joe English - * Copyright (c) 2005 Neil Madden - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2008-2009 Apple Inc. - * Copyright (c) 2009 Kevin Walzer/WordTech Communications LLC. - * Copyright (c) 2019 Marc Culler + * Copyright © 2004 Joe English + * Copyright © 2005 Neil Madden + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2008-2009 Apple Inc. + * Copyright © 2009 Kevin Walzer/WordTech Communications LLC. + * Copyright © 2019 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES.