1
2tkimg_Fix*Proc's
3
4Signature of photo image type functions
5
6
7 Tk 8.3.2 or earlier Tk 8.3 or later
8==============================================================================
9Tk_ImageStringWriteProc int int
10 ------------------------------------------------------
11 Tcl_Interp *interp, Tcl_Interp *interp,
12 Tcl_DString *dataPtr, Tcl_Obj *format,
13 char *formatString, Tk_PhotoImageBlock *blockPtr
14 Tk_PhotoImageBlock *blockPtr
15==============================================================================
16Tk_ImageFileMatchProc int int
17 ------------------------------------------------------
18 Tcl_Channel chan, Tcl_Channel chan,
19 char *fileName, CONST char *fileName,
20 char *formatString, Tcl_Obj *format,
21 int *widthPtr, int *widthPtr,
22 int *heightPtr int *heightPtr,
23 Tcl_Interp *interp
24==============================================================================
25Tk_ImageStringMatchProc int int
26 ------------------------------------------------------
27 char *string, Tcl_Obj *dataObj,
28 char *formatString, Tcl_Obj *format,
29 int *widthPtr, int *widthPtr,
30 int *heightPtr int *heightPtr,
31 Tcl_Interp *interp
32==============================================================================
33
34Different number of arguments, with different types, and the arguments
35are permuted.
36
37A Tk 8.3 core takes special steps so that a specially written photo
38image can distinguish between the two possible types of calls using
39the arguments alone.
40
41It always calls the function with the maximal number of arguments
42possible, padding with NULLs if the 8.3 signature has not enough
43arguments. See 'Tk_ImageStringWriteProc' (tkImgPhoto.c, line 962).
44
45In the case of the other two procedures the photo image type can check
46the integrity of the last argument to distinguish between the two
47cores. When called from an 8.3.2 or earlier core the last argument
48will be bogus (random data).
49
50This is actually the method used by Img 1.2.4. It checks that
51interp->result == interp->resultSpace. There are two problems with
52that approach:
53
54(1) The pointer stored in 'interp' is random, and might not be
55 dereferencable. In other words, a segementation fault can
56 happen. Just assume 'interp == NULL' for example.
57
58(2) It requires access to private definitions of the core
59 (Definition of 'struct Interp').
60
61Because this Img 2.0 will use a different approach. When loaded into
62the system it will ask for the current version of Tk, and modify its
63behaviour accordingly.
64
65
66 tkimg_FixChanMatchProc (interp, chan, file, format, width, height)
67 tkimg_FixObjMatchProc (interp, data, format, width, height)
68 tkimg_FixStringWriteProc(data, interp, dataPtr, format, blockPtr)
69