summaryrefslogtreecommitdiffstats
path: root/generic/tkStubImg.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-05-14 20:58:24 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-05-14 20:58:24 (GMT)
commit63b954a5775049b63f7067e80d9c1b31c8176222 (patch)
tree288d4d74decb1ae3a9c5616c310ea88b3b8bee31 /generic/tkStubImg.c
parente34b1b4d9d3de8cc8c9af59dc8e6927c0af02283 (diff)
downloadtk-63b954a5775049b63f7067e80d9c1b31c8176222.zip
tk-63b954a5775049b63f7067e80d9c1b31c8176222.tar.gz
tk-63b954a5775049b63f7067e80d9c1b31c8176222.tar.bz2
[Tk Bug 1712081]
* unix/Makefile.in: Updates to account for new and deleted files * win/Makefile.in: tkStubImg.c and tkOldTest.c. * win/makefile.bc: * win/makefile.vc: * generic/tkOldTest.c (new): New file used to create testing * generic/tkTest.c: commands for testing various Tk * tests/constraints.tcl: legacy interfaces where a separate * tests/image.test: compilation unit is needed in order to #define suitable macros during compilation. Only the effect of USE_OLD_IMAGE on Tk_CreateImageType() is currently tested, but more similar testing commands can be added to this same file. New constraint defined to detect presence of the image type provided by the new testing code, and a few tests added to exercise it. Having USE_OLD_IMAGE support tested by the default test suite should reduce chance of a recurrence of this bug. * doc/CrtImgType.3: Revised docs to better indicate the legacy * doc/CrtPhImgFmt.3: nature of the interfaces supported by USE_OLD_IMAGE. * generic/tkDecls.h: make genstubs * generic/tkStubInit.c: * generic/tk.decls: Reworked USE_OLD_IMAGE support to use * generic/tk.h: the same support mechanisms both with * generic/tkStubImg.c (deleted):and without a stub-enabled build. In each case, route the legacy calls to Tk_CreateImageType and Tk_CreatePhotoImageFormat through the Tk_CreateOldImageType and Tk_CreateOldPhotoImageFormat routines. Add those routines to the public stub table so they're available to a stub-enabled extension. Remove the definition of Tk_InitImageArgs() and use a macro to convert any calls to it in source code into a comment. * generic/tkImage.c: Removed the MODULE_SCOPE declarations that * generic/tkImgPhoto.c: broke USE_OLD_IMAGE support.
Diffstat (limited to 'generic/tkStubImg.c')
-rw-r--r--generic/tkStubImg.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/generic/tkStubImg.c b/generic/tkStubImg.c
deleted file mode 100644
index 88b7efe..0000000
--- a/generic/tkStubImg.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * tkStubImg.c --
- *
- * Stub object that will be statically linked into extensions that wish
- * to access Tk.
- *
- * Copyright (c) 1999 Jan Nijtmans.
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tkStubImg.c,v 1.4 2005/11/15 15:18:22 dkf Exp $
- */
-
-#include "tcl.h"
-
-
-/*
- *----------------------------------------------------------------------
- *
- * Tk_InitImageArgs --
- *
- * Performs the necessary conversion from Tcl_Obj's to strings in the
- * createProc for Tcl_CreateImageType. If running under Tk 8.2 or earlier
- * without the Img-patch, this function has no effect.
- *
- * Results:
- * argvPtr will point to an argument list which is guaranteed to contain
- * strings, no matter what Tk version is running.
- *
- * Side effects:
- * None
- *
- *----------------------------------------------------------------------
- */
-
-#ifdef Tk_InitImageArgs
-#undef Tk_InitImageArgs
-#endif
-
-void
-Tk_InitImageArgs(
- Tcl_Interp *interp,
- int argc,
- char ***argvPtr)
-{
- static int useNewImage = -1;
- static char **argv = NULL;
-
- if (argv) {
- tclStubsPtr->tcl_Free((char *) argv);
- argv = NULL;
- }
-
- if (useNewImage < 0) {
- Tcl_CmdInfo cmdInfo;
-
- /*
- * Note that this is *not* safe; users are free to rename the [image]
- * command. Sometime should fix to use assocData instead?
- */
-
- if (!tclStubsPtr->tcl_GetCommandInfo(interp, "image", &cmdInfo)) {
- tclStubsPtr->tcl_Panic("cannot find the \"image\" command");
- }
- if (cmdInfo.isNativeObjectProc == 1) {
- useNewImage = 1; /* Tk uses the new image interface */
- } else {
- useNewImage = 0; /* Tk uses old image interface */
- }
- }
- if (useNewImage && (argc > 0)) {
- int i;
-
- argv = (char **) tclStubsPtr->tcl_Alloc(argc * sizeof(char *));
- for (i = 0; i < argc; i++) {
- argv[i] = tclStubsPtr->tcl_GetString((Tcl_Obj *)(*argvPtr)[i]);
- }
- *argvPtr = (char **) argv;
- }
-}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */