Import Tk 8.6.11
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
|
||||
Tk_CreateImageType, Tk_GetImageMasterData, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
@@ -19,6 +19,11 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind o
|
||||
ClientData
|
||||
\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
|
||||
.sp
|
||||
.VS "TIP 581"
|
||||
ClientData
|
||||
\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR)
|
||||
.VE "TIP 581"
|
||||
.sp
|
||||
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tk_ImageType" *typePtrPtr
|
||||
@@ -71,7 +76,7 @@ The fields of this structure will be described in later subsections
|
||||
of this entry.
|
||||
.PP
|
||||
The second major data structure manipulated by an image manager
|
||||
is called an \fIimage master\fR; it contains overall information
|
||||
is called an \fIimage model\fR; it contains overall information
|
||||
about a particular image, such as the values of the configuration
|
||||
options specified in an \fBimage create\fR command.
|
||||
There will usually be one of these structures for each
|
||||
@@ -113,8 +118,8 @@ typedef int \fBTk_ImageCreateProc\fR(
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[],
|
||||
const Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImaster\fR,
|
||||
ClientData *\fImasterDataPtr\fR);
|
||||
Tk_ImageMaster \fImodel\fR,
|
||||
ClientData *\fImodelDataPtr\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the \fBimage\fR
|
||||
command was invoked, and \fIname\fR is the name for the new image,
|
||||
@@ -123,15 +128,15 @@ or generated automatically by the \fBimage\fR command.
|
||||
The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration
|
||||
options for the new image (everything after the name argument to
|
||||
\fBimage\fR).
|
||||
The \fImaster\fR argument is a token that refers to Tk's information
|
||||
The \fImodel\fR argument is a token that refers to Tk's information
|
||||
about this image; the image manager must return this token to
|
||||
Tk when invoking the \fBTk_ImageChanged\fR procedure.
|
||||
Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR
|
||||
and create an image master data structure for the new image.
|
||||
and create an image model data structure for the new image.
|
||||
\fIcreateProc\fR may store an arbitrary one-word value at
|
||||
*\fImasterDataPtr\fR, which will be passed back to the
|
||||
*\fImodelDataPtr\fR, which will be passed back to the
|
||||
image manager when other callbacks are invoked.
|
||||
Typically the value is a pointer to the master data
|
||||
Typically the value is a pointer to the model data
|
||||
structure for the image.
|
||||
.PP
|
||||
If \fIcreateProc\fR encounters an error, it should leave an error
|
||||
@@ -148,11 +153,11 @@ This procedure must match the following prototype:
|
||||
.CS
|
||||
typedef ClientData \fBTk_ImageGetProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
ClientData \fImasterData\fR);
|
||||
ClientData \fImodelData\fR);
|
||||
.CE
|
||||
The \fItkwin\fR argument identifies the window in which the
|
||||
image will be used and \fImasterData\fR is the value
|
||||
returned by \fIcreateProc\fR when the image master was created.
|
||||
image will be used and \fImodelData\fR is the value
|
||||
returned by \fIcreateProc\fR when the image model was created.
|
||||
\fIgetProc\fR will usually create a data structure for the new
|
||||
instance, including such things as the resources needed to
|
||||
display the image in the given window.
|
||||
@@ -221,26 +226,30 @@ each of the image's instances.
|
||||
\fIdeleteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void \fBTk_ImageDeleteProc\fR(
|
||||
ClientData \fImasterData\fR);
|
||||
ClientData \fImodelData\fR);
|
||||
.CE
|
||||
The \fImasterData\fR argument will be the same as the value
|
||||
stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the
|
||||
The \fImodelData\fR argument will be the same as the value
|
||||
stored in \fI*modelDataPtr\fR by \fIcreateProc\fR when the
|
||||
image was created.
|
||||
\fIdeleteProc\fR should release any resources associated with
|
||||
the image.
|
||||
.SH TK_GETIMAGEMASTERDATA
|
||||
.SH TK_GETIMAGEMODELDATA
|
||||
.PP
|
||||
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
|
||||
information about an image. For example, an image manager can use this
|
||||
procedure to locate its image master data for an image.
|
||||
procedure to locate its image model data for an image.
|
||||
If there exists an image named \fIname\fR
|
||||
in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is
|
||||
filled in with type information for the image (the \fItypePtr\fR value
|
||||
passed to \fBTk_CreateImageType\fR when the image type was registered)
|
||||
and the return value is the ClientData value returned by the
|
||||
\fIcreateProc\fR when the image was created (this is typically a
|
||||
pointer to the image master data structure). If no such image exists
|
||||
pointer to the image model data structure). If no such image exists
|
||||
then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
|
||||
.PP
|
||||
.VS "TIP 581"
|
||||
\fBTk_GetImageModelData\fR is synonym for \fBTk_GetImageMasterData\fR
|
||||
.VE "TIP 581"
|
||||
.SH "LEGACY INTERFACE SUPPORT"
|
||||
.PP
|
||||
In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
|
||||
@@ -252,8 +261,8 @@ typedef int \fBTk_ImageCreateProc\fR(
|
||||
int \fIargc\fR,
|
||||
char **\fIargv\fR,
|
||||
Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImaster\fR,
|
||||
ClientData *\fImasterDataPtr\fR);
|
||||
Tk_ImageMaster \fImodel\fR,
|
||||
ClientData *\fImodelDataPtr\fR);
|
||||
.CE
|
||||
Legacy programs and libraries dating from those days may still
|
||||
contain code that defines extended Tk image types using the old
|
||||
@@ -261,6 +270,10 @@ interface. The Tk header file will still support this legacy
|
||||
interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
|
||||
defined.
|
||||
.PP
|
||||
.VS "TIP 581"
|
||||
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
|
||||
.VE "TIP 581"
|
||||
.PP
|
||||
When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may
|
||||
see the routine \fBTk_InitImageArgs\fR in use. This was a migration
|
||||
tool used to create stub-enabled extensions that could be loaded
|
||||
@@ -280,4 +293,4 @@ interfaces. Expect their support to go away in Tk 9.
|
||||
.SH "SEE ALSO"
|
||||
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
|
||||
.SH KEYWORDS
|
||||
image manager, image type, instance, master
|
||||
image manager, image type, instance, model
|
||||
|
||||
Reference in New Issue
Block a user