4 * Stub object that will be statically linked into extensions that wish
7 * Copyright (c) 1999 Jan Nijtmans.
8 * Copyright (c) 1998-1999 by Scriptics Corporation.
10 * See the file "license.terms" for information on usage and redistribution
11 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
20 *----------------------------------------------------------------------
24 * Performs the necessary conversion from Tcl_Obj's to strings
25 * in the createProc for Tcl_CreateImageType. If running under
26 * Tk 8.2 or earlier without the Img-patch, this function has
30 * argvPtr will point to an argument list which is guaranteed to
31 * contain strings, no matter what Tk version is running.
36 *----------------------------------------------------------------------
39 #ifdef Tk_InitImageArgs
40 #undef Tk_InitImageArgs
44 Tk_InitImageArgs(interp, argc, argvPtr)
49 static useNewImage = -1;
50 static char **argv = NULL;
53 tclStubsPtr->tcl_Free((char *) argv);
57 if (useNewImage < 0) {
59 if (!tclStubsPtr->tcl_GetCommandInfo(interp,"image", &cmdInfo)) {
60 tclStubsPtr->tcl_Panic("cannot find the \"image\" command");
62 if (cmdInfo.isNativeObjectProc == 1) {
63 useNewImage = 1; /* Tk uses the new image interface */
65 useNewImage = 0; /* Tk uses old image interface */
68 if (useNewImage && (argc > 0)) {
70 argv = (char **) tclStubsPtr->tcl_Alloc(argc * sizeof(char *));
71 for (i = 0; i < argc; i++) {
72 argv[i] = tclStubsPtr->tcl_GetString((Tcl_Obj *)(*argvPtr)[i]);
74 *argvPtr = (char **) argv;