head	1.16;
access;
symbols
	core-8-5-9:1.12
	core-8-5-8:1.12
	macosx-cocoa-merge:1.15
	macosx-cocoa-premerge:1.15
	macosx-carbon-freeze:1.15
	core-8-5-7:1.12
	core-8-5-6:1.12
	core-8-6-b1:1.14
	core-8-6-a3:1.13
	core-8-5-5:1.12
	core-8-6-a2:1.13
	core-8-5-4:1.12
	core-8-5-3:1.12
	core-8-6-a1:1.12
	core-8-4-19:1.6
	core-8-5-branch:1.12.0.2
	core-8-5-2:1.12
	core-8-4-18:1.6
	core-8-5-1:1.12
	core-8-4-17:1.6
	core-8-5-0:1.12
	core-8-5-b3:1.11
	core-8-5-b2:1.10
	core-8-4-16:1.6
	core-8-5-b1:1.10
	core-stablilizer-merge:1.10
	core-stabilizer-branch:1.10.0.2
	core-stabilizer-merge:1.12
	core-8-4-15:1.6
	core-8-5-a6:1.10
	core-8-5-a5:1.9
	core-8-4-14:1.6
	core-8-5-a4:1.9
	core-8-4-13:1.6
	core-8-4-12:1.6
	core-8-4-11:1.6
	core-8-5-a3:1.8
	core-8-4-10:1.6
	core-8-4-9-branch:1.6.0.12
	core-8-5-a2:1.8
	core-8-4-9:1.6
	core-8-4-8:1.6
	core-8-4-7:1.6
	core-8-5-a1:1.6
	core-8-4-6:1.6
	core-8-4-5:1.6
	mistachkin-dev-branch:1.6.0.10
	core-8-4-4:1.6
	core-8-4-3:1.6
	core-8-4-branch:1.6.0.8
	core-8-4-2:1.6
	core-8-4-1:1.6
	core-8-3-5:1.5.2.1
	core-8-4-0:1.6
	macosx-8-4-merge-2002-08-31-trunk:1.6
	macosx-8-4-premerge-2002-08-31-branch:1.6
	macosx-8-4-premerge-2002-08-31-trunk:1.6
	macosx-8-4-merge-2002-08-30-branch:1.6
	macosx-8-4-merge-2002-08-30-trunk:1.6
	macosx-8-4-merge-2002-08-20-branch:1.6
	macosx-8-4-merge-2002-08-20-trunk:1.6
	core-8-4-b2:1.6
	core-8-4-b1:1.6
	macosx-premerge-6-9-02:1.6
	core-8-4-a4:1.6
	core-8-3-4:1.5.2.1
	macosx-8-4-branch:1.6.0.6
	macosx-8-4-branchpoint:1.6
	core-8-4-a3:1.6
	core-8-3-3:1.5.2.1
	dgp-privates-into-namespace:1.6.0.4
	tclpro-1-5-0:1.5
	core-8-4-win-speedup:1.6.0.2
	core-8-4-a2:1.6
	tclpro-1-4-1:1.5
	tclpro-1-4-0:1.5
	core-8-3-2:1.5
	ajuba-ajuba2-2-1-base:1.5
	ajuba-ajuba2-2-0:1.5
	core-8-4-a1:1.5
	core-8-3-1-branch:1.5.0.2
	core-8-3-1:1.5
	scriptics-sc-2-0-b5:1.5
	scriptics-sc-2-0-fixed:1.5
	scriptics-sc-2-0-b2:1.5
	scriptics-sc-2-0-b1:1.5
	core-8-3-0:1.4
	core-8-3-b2:1.4
	core-8-3-b1:1.4
	scriptics-sc-1-1:1.4
	scriptics-sc-1-1-b1:1.4
	core-8-2-3:1.4
	scriptics-sc-1-1-branch:1.4.0.10
	scriptics-sc-1-1-base:1.4
	scriptics-sc-1-0:1.4
	scriptics-sc-1-0-branch:1.4.0.8
	scriptics-sc-1-0-base:1.4
	core-8-2-2:1.4
	core-8-2-1:1.4
	scriptics-bc-1-0-b1:1.4
	core-8-2-1-branch:1.4.0.6
	scriptics-tclpro-1-3-0:1.4
	core-8-2-0:1.4
	core-8-2-b3-branch:1.4.0.2
	core-8-2-b3-base:1.4
	scriptics-tclpro-1-3-b4:1.4
	core-8-2-b2:1.4
	scriptics-tclpro-1-3-b3:1.4
	core-8-2-b1:1.4
	scriptics-tclpro-1-3-b2:1.4
	merge-to-mainline-5/21/99:1.4
	scriptics-tclpro-1-3-b2-branch:1.4.0.4
	core-8-1-1:1.4
	scriptics-tclpro-1-3-b1:1.4
	core-8-1-1-base:1.4
	core-8-1-0:1.4
	merge-to-mainline-4-29-99:1.4
	merge-to-mainline-4-23-99:1.4
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.1
	core-8-1-b2:1.1.4.1
	dev-8-1-stubs-branch:1.1.4.1.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.1
	core-8-0-4:1.2
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.16
date	2010.02.17.19.21.17;	author nijtmans;	state Exp;
branches;
next	1.15;

1.15
date	2009.01.06.21.58.15;	author nijtmans;	state Exp;
branches;
next	1.14;

1.14
date	2008.11.01.17.26.36;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2008.06.30.22.57.01;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2007.12.13.15.23.42;	author dgp;	state Exp;
branches;
next	1.11;

1.11
date	2007.10.29.16.04.12;	author dkf;	state Exp;
branches;
next	1.10;

1.10
date	2007.01.05.00.00.48;	author nijtmans;	state Exp;
branches
	1.10.2.1;
next	1.9;

1.9
date	2005.08.17.06.20.25;	author georgeps;	state Exp;
branches;
next	1.8;

1.8
date	2004.09.19.16.05.36;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2004.08.22.15.43.20;	author dkf;	state Exp;
branches;
next	1.6;

1.6
date	2000.07.25.21.14.34;	author jenglish;	state Exp;
branches;
next	1.5;

1.5
date	2000.03.02.21.53.00;	author hobbs;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	99.04.21.21.53.20;	author rjohnson;	state Exp;
branches;
next	1.3;

1.3
date	99.04.16.18.26.12;	author surles;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.22.47;	author stanton;	state Exp;
branches
	1.2.8.1;
next	1.1;

1.1
date	98.04.01.09.40.01;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.15.48;	author stanton;	state Exp;
branches;
next	;

1.2.8.1
date	99.04.21.02.32.54;	author rjohnson;	state Exp;
branches;
next	;

1.5.2.1
date	2001.04.04.07.23.48;	author hobbs;	state Exp;
branches;
next	;

1.10.2.1
date	2007.11.01.16.37.12;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.16
log
@CONSTify everything related to Tk_ConfigSpec
@
text
@'\"
'\" Copyright (c) 1994-1995 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.15 2009/01/06 21:58:15 nijtmans Exp $
'\" 
.so man.macros
.TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_CreateItemType, Tk_GetItemTypes \- define new kind of canvas item
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
\fBTk_CreateItemType\fR(\fItypePtr\fR)
.sp
Tk_ItemType *
\fBTk_GetItemTypes\fR()
.SH ARGUMENTS
.AS Tk_ItemType *typePtr
.AP Tk_ItemType *typePtr in
Structure that defines the new type of canvas item.
.BE
.SH INTRODUCTION
.PP
\fBTk_CreateItemType\fR is invoked to define a new kind of canvas item
described by the \fItypePtr\fR argument.
An item type corresponds to a particular value of the \fItype\fR
argument to the \fBcreate\fR widget command for canvases, and
the code that implements a canvas item type is called a \fItype manager\fR.
Tk defines several built-in item types, such as \fBrectangle\fR
and \fBtext\fR and \fBimage\fR, but \fBTk_CreateItemType\fR
allows additional item types to be defined.
Once \fBTk_CreateItemType\fR returns, the new item type may be used
in new or existing canvas widgets just like the built-in item
types.
.PP
\fBTk_GetItemTypes\fR returns a pointer to the first in the list
of all item types currently defined for canvases.
The entries in the list are linked together through their
\fInextPtr\fR fields, with the end of the list marked by a
NULL \fInextPtr\fR.
.PP
You may find it easier to understand the rest of this manual entry
by looking at the code for an existing canvas item type such as
bitmap (in the file tkCanvBmap.c) or text (tkCanvText.c).
The easiest way to create a new type manager is to copy the code
for an existing type and modify it for the new type.
.PP
Tk provides a number of utility procedures for the use of canvas
type managers, such as \fBTk_CanvasCoords\fR and \fBTk_CanvasPsColor\fR;
these are described in separate manual entries.
.SH "DATA STRUCTURES"
.PP
A type manager consists of a collection of procedures that provide a
standard set of operations on items of that type.
The type manager deals with three kinds of data
structures.
The first data structure is a Tk_ItemType; it contains
information such as the name of the type and pointers to
the standard procedures implemented by the type manager:
.PP
.CS
typedef struct Tk_ItemType {
    const char *\fIname\fR;
    int \fIitemSize\fR;
    Tk_ItemCreateProc *\fIcreateProc\fR;
    const Tk_ConfigSpec *\fIconfigSpecs\fR;
    Tk_ItemConfigureProc *\fIconfigProc\fR;
    Tk_ItemCoordProc *\fIcoordProc\fR;
    Tk_ItemDeleteProc *\fIdeleteProc\fR;
    Tk_ItemDisplayProc *\fIdisplayProc\fR;
    int \fIalwaysRedraw\fR;
    Tk_ItemPointProc *\fIpointProc\fR;
    Tk_ItemAreaProc *\fIareaProc\fR;
    Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
    Tk_ItemScaleProc *\fIscaleProc\fR;
    Tk_ItemTranslateProc *\fItranslateProc\fR;
    Tk_ItemIndexProc *\fIindexProc\fR;
    Tk_ItemCursorProc *\fIicursorProc\fR;
    Tk_ItemSelectionProc *\fIselectionProc\fR;
    Tk_ItemInsertProc *\fIinsertProc\fR;
    Tk_ItemDCharsProc *\fIdCharsProc\fR;
    Tk_ItemType *\fInextPtr\fR;
} \fBTk_ItemType\fR;
.CE
.PP
The fields of a Tk_ItemType structure are described in more detail
later in this manual entry.
When \fBTk_CreateItemType\fR is called, its \fItypePtr\fR
argument must point to a structure with all of the fields initialized
except \fInextPtr\fR, which Tk sets to link all the types together
into a list.
The structure must be in permanent memory (either statically
allocated or dynamically allocated but never freed); Tk retains
a pointer to this structure.
.PP
The second data structure manipulated by a type manager is an
\fIitem record\fR.
For each item in a canvas there exists one item record.
All of the items of a given type generally have item records with
the same structure, but different types usually have different
formats for their item records.
The first part of each item record is a header with a standard structure
defined by Tk via the type Tk_Item; the rest of the item
record is defined by the type manager.
A type manager must define its item records with a Tk_Item as
the first field.
For example, the item record for bitmap items is defined as follows:
.PP
.CS
typedef struct BitmapItem {
    Tk_Item \fIheader\fR;
    double \fIx\fR, \fIy\fR;
    Tk_Anchor \fIanchor\fR;
    Pixmap \fIbitmap\fR;
    XColor *\fIfgColor\fR;
    XColor *\fIbgColor\fR;
    GC \fIgc\fR;
} \fBBitmapItem\fR;
.CE
.PP
The \fIheader\fR substructure contains information used by Tk
to manage the item, such as its identifier, its tags, its type,
and its bounding box.
The fields starting with \fIx\fR belong to the type manager:
Tk will never read or write them.
The type manager should not need to read or write any of the
fields in the header except for four fields
whose names are \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
These fields give a bounding box for the items using integer
canvas coordinates: the item should not cover any pixels
with x-coordinate lower than \fIx1\fR or y-coordinate
lower than \fIy1\fR, nor should it cover any pixels with
x-coordinate greater than or equal to \fIx2\fR or y-coordinate
greater than or equal to \fIy2\fR.
It is up to the type manager to keep the bounding box up to
date as the item is moved and reconfigured.
.PP
Whenever Tk calls a procedure in a type manager it passes in a pointer
to an item record.
The argument is always passed as a pointer to a Tk_Item; the type
manager will typically cast this into a pointer to its own specific
type, such as BitmapItem.
.PP
The third data structure used by type managers has type
Tk_Canvas; it serves as an opaque handle for the canvas widget
as a whole.
Type managers need not know anything about the contents of this
structure.
A Tk_Canvas handle is typically passed in to the
procedures of a type manager, and the type manager can pass the
handle back to library procedures such as Tk_CanvasTkwin
to fetch information about the canvas.
.SH "TK_ITEMTYPE FIELDS"
.SS NAME
.PP
This section and the ones that follow describe each of the fields
in a Tk_ItemType structure in detail.
The \fIname\fR field provides a string name for the item type.
Once \fBTk_CreateImageType\fR returns, this name may be used
in \fBcreate\fR widget commands to create items of the new
type.
If there already existed an item type by this name then
the new item type replaces the old one.
.SS "FLAGS (IN ALWAYSREDRAW)"
.PP
The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons)
contains a collection of flag bits that modify how the canvas core interacts
with the item. The following bits are defined:
.TP
\fB1\fR
.
Indicates that the item should always be redrawn when any part of the canvas
is redrawn, rather than only when the bounding box of the item overlaps the
area being redrawn. This is used by window items, for example, which need to
unmap subwindows that are not on the screen.
.TP
\fBTK_CONFIG_OBJS\fR
.
Indicates that operations which would otherwise take a string (or array of
strings) actually take a Tcl_Obj reference (or an array of such references).
The operations to which this applies are the \fIconfigProc\fR, the
\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the
\fIinsertProc\fR.
.TP
\fBTK_MOVABLE_POINTS\fR
.VS 8.6
Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and
\fIinsertProc\fR with the same semantics as Tk's built-in line and polygon
types, and that hence individual coordinate points can be moved. Must not be
set if any of the above methods is NULL.
.VE 8.6
.SS ITEMSIZE
.PP
\fItypePtr\->itemSize\fR gives the size in bytes of item records
of this type, including the Tk_Item header.
Tk uses this size to allocate memory space for items of the type.
All of the item records for a given type must have the same size.
If variable length fields are needed for an item (such as a list
of points for a polygon), the type manager can allocate a separate
object of variable length and keep a pointer to it in the item record.
.SS CREATEPROC
.PP
\fItypePtr\->createProc\fR points to a procedure for
Tk to call whenever a new item of this type is created.
\fItypePtr\->createProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemCreateProc\fR(
        Tcl_Interp *\fIinterp\fR,
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIobjc\fR,
        Tcl_Obj *const \fIobjv\fR[]);
.CE
.PP
The \fIinterp\fR argument is the interpreter in which the canvas's
\fBcreate\fR widget command was invoked, and \fIcanvas\fR is a
handle for the canvas widget.
\fIitemPtr\fR is a pointer to a newly-allocated item of
size \fItypePtr\->itemSize\fR.
Tk has already initialized the item's header (the first
\fBsizeof(Tk_ItemType)\fR bytes).
The \fIobjc\fR and \fIobjv\fR arguments describe all of the
arguments to the \fBcreate\fR command after the \fItype\fR
argument.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
contain a pointer to an array of constant strings.
For example, in the widget command:
.PP
.CS
\fB\&.c create rectangle 10 20 50 50 \-fill black\fR
.CE
.PP
\fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the
integer object \fB10\fR.
.PP
\fIcreateProc\fR should use \fIobjc\fR and \fIobjv\fR to initialize
the type-specific parts of the item record and set an initial value
for the bounding box in the item's header.
It should return a standard Tcl completion code and leave an
error message in the interpreter result if an error occurs.
If an error occurs Tk will free the item record, so \fIcreateProc\fR
must be sure to leave the item record in a clean state if it returns an error
(e.g., it must free any additional memory that it allocated for
the item).
.SS CONFIGSPECS
.PP
Each type manager must provide a standard table describing its
configuration options, in a form suitable for use with
\fBTk_ConfigureWidget\fR.
This table will normally be used by \fItypePtr\->createProc\fR
and \fItypePtr\->configProc\fR, but Tk also uses it directly
to retrieve option information in the \fBitemcget\fR and
\fBitemconfigure\fR widget commands.
\fItypePtr\->configSpecs\fR must point to the configuration table
for this type.
Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR
for implementing the \fB\-tags\fR option; see an existing type
manager for an example of how to use it in \fIconfigSpecs\fR.
.SS CONFIGPROC
.PP
\fItypePtr\->configProc\fR is called by Tk whenever the
\fBitemconfigure\fR widget command is invoked to change the
configuration options for a canvas item.
This procedure must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemConfigureProc\fR(
        Tcl_Interp *\fIinterp\fR,
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIobjc\fR,
        Tcl_Obj *const \fIobjv\fR[],
        int \fIflags\fR);
.CE
.PP
The \fIinterp\fR argument identifies the interpreter in which the
widget command was invoked, \fIcanvas\fR is a handle for the canvas
widget, and \fIitemPtr\fR is a pointer to the item being configured.
\fIobjc\fR and \fIobjv\fR contain the configuration options.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
contain a pointer to an array of constant strings.
For example, if the following command is invoked:
.PP
.CS
\fB\&.c itemconfigure 2 \-fill red \-outline black\fR
.CE
.PP
\fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR
through \fBblack\fR.
\fIobjc\fR will always be an even value.
The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
currently this value is always \fBTK_CONFIG_ARGV_ONLY\fR when Tk
invokes \fItypePtr\->configProc\fR, but the type manager's \fIcreateProc\fR
procedure will usually invoke \fIconfigProc\fR with different flag values.
.PP
\fItypePtr\->configProc\fR returns a standard Tcl completion code and
leaves an error message in the interpreter result if an error occurs.
It must update the item's bounding box to reflect the new configuration
options.
.SS COORDPROC
.PP
\fItypePtr\->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
widget command for an item.
It must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemCoordProc\fR(
        Tcl_Interp *\fIinterp\fR,
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIobjc\fR,
        Tcl_Obj *const \fIobjv\fR[]);
.CE
.PP
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
describe the coordinate arguments.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
contain a pointer to an array of constant strings.
For example, if the following widget command is invoked:
.PP
.CS
\fB\&.c coords 2 30 90\fR
.CE
.PP
\fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects
\fB30\fR and \fB90\fR.
.PP
The \fIcoordProc\fR procedure should process the new coordinates,
update the item appropriately (e.g., it must reset the bounding
box in the item's header), and return a standard Tcl completion
code.
If an error occurs, \fIcoordProc\fR must leave an error message in
the interpreter result.
.SS DELETEPROC
.PP
\fItypePtr\->deleteProc\fR is invoked by Tk to delete an item
and free any resources allocated to it.
It must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemDeleteProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        Display *\fIdisplay\fR);
.CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual
interpretations, and \fIdisplay\fR identifies the X display containing
the canvas.
\fIdeleteProc\fR must free up any resources allocated for the item,
so that Tk can free the item record.
\fIdeleteProc\fR should not actually free the item record; this will
be done by Tk when \fIdeleteProc\fR returns.
.SS "DISPLAYPROC"
.PP
\fItypePtr\->displayProc\fR is invoked by Tk to redraw an item
on the screen.
It must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemDisplayProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        Display *\fIdisplay\fR,
        Drawable \fIdst\fR,
        int \fIx\fR,
        int \fIy\fR,
        int \fIwidth\fR,
        int \fIheight\fR);
.CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIdisplay\fR identifies the display containing the canvas, and
\fIdst\fR specifies a drawable in which the item should be rendered;
typically this is an off-screen pixmap, which Tk will copy into
the canvas's window once all relevant items have been drawn.
\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR specify a rectangular
region in canvas coordinates, which is the area to be redrawn;
only information that overlaps this area needs to be redrawn.
Tk will not call \fIdisplayProc\fR unless the item's bounding box
overlaps the redraw area, but the type manager may wish to use
the redraw area to optimize the redisplay of the item.
.PP
Because of scrolling and the use of off-screen pixmaps for
double-buffered redisplay, the item's coordinates in \fIdst\fR
will not necessarily be the same as those in the canvas.
\fIdisplayProc\fR should call \fBTk_CanvasDrawableCoords\fR
to transform coordinates from those of the canvas to those
of \fIdst\fR.
.PP
Normally an item's \fIdisplayProc\fR is only invoked if the item
overlaps the area being displayed.
However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1,
(i.e.\|
.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" )
then \fIdisplayProc\fR is invoked during every redisplay operation,
even if the item does not overlap the area of redisplay; this is useful for
cases such as window items, where the subwindow needs to be unmapped when it
is off the screen.
.SS POINTPROC
.PP
\fItypePtr\->pointProc\fR is invoked by Tk to find out how close
a given point is to a canvas item.
Tk uses this procedure for purposes such as locating the item
under the mouse or finding the closest item to a given point.
The procedure must match the following prototype:
.PP
.CS
typedef double \fBTk_ItemPointProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        double *\fIpointPtr\fR);
.CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIpointPtr\fR points to an array of two numbers giving
the x and y coordinates of a point.
\fIpointProc\fR must return a real value giving the distance
from the point to the item, or 0 if the point lies inside
the item.
.SS AREAPROC
.PP
\fItypePtr\->areaProc\fR is invoked by Tk to find out the relationship
between an item and a rectangular area.
It must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemAreaProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        double *\fIrectPtr\fR);
.CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIrectPtr\fR points to an array of four real numbers;
the first two give the x and y coordinates of the upper left
corner of a rectangle, and the second two give the x and y
coordinates of the lower right corner.
\fIareaProc\fR must return \-1 if the item lies entirely outside
the given area, 0 if it lies partially inside and partially
outside the area, and 1 if it lies entirely inside the area.
.SS POSTSCRIPTPROC
.PP
\fItypePtr\->postscriptProc\fR is invoked by Tk to generate
Postscript for an item during the \fBpostscript\fR widget command.
If the type manager is not capable of generating Postscript then
\fItypePtr\->postscriptProc\fR should be NULL.
The procedure must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemPostscriptProc\fR(
        Tcl_Interp *\fIinterp\fR,
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIprepass\fR);
.CE
.PP
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have
standard meanings; \fIprepass\fR will be described below.
If \fIpostscriptProc\fR completes successfully, it should append
Postscript for the item to the information in the interpreter result
(e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR)
and return \fBTCL_OK\fR.
If an error occurs, \fIpostscriptProc\fR should clear the result
and replace its contents with an error message; then it should
return \fBTCL_ERROR\fR.
.PP
Tk provides a collection of utility procedures to simplify
\fIpostscriptProc\fR.
For example, \fBTk_CanvasPsColor\fR will generate Postscript to set
the current color to a given Tk color and \fBTk_CanvasPsFont\fR will
set up font information.
When generating Postscript, the type manager is free to change the
graphics state of the Postscript interpreter, since Tk places
\fBgsave\fR and \fBgrestore\fR commands around the Postscript for
the item.
The type manager can use canvas x coordinates directly in its Postscript,
but it must call \fBTk_CanvasPsY\fR to convert y coordinates from
the space of the canvas (where the origin is at the
upper left) to the space of Postscript (where the origin is at the
lower left).
.PP
In order to generate Postscript that complies with the Adobe Document
Structuring Conventions, Tk actually generates Postscript in two passes.
It calls each item's \fIpostscriptProc\fR in each pass.
The only purpose of the first pass is to collect font information
(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
discarded.
Tk sets the \fIprepass\fR argument to \fIpostscriptProc\fR to 1
during the first pass; the type manager can use \fIprepass\fR to skip
all Postscript generation except for calls to \fBTk_CanvasPsFont\fR.
During the second pass \fIprepass\fR will be 0, so the type manager
must generate complete Postscript.
.SS SCALEPROC
.PP
\fItypePtr\->scaleProc\fR is invoked by Tk to rescale a canvas item
during the \fBscale\fR widget command.
The procedure must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemScaleProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        double \fIoriginX\fR,
        double \fIoriginY\fR,
        double \fIscaleX\fR,
        double \fIscaleY\fR);
.CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIoriginX\fR and \fIoriginY\fR specify an origin relative to which
the item is to be scaled, and \fIscaleX\fR and \fIscaleY\fR give the
x and y scale factors.
The item should adjust its coordinates so that a point in the item
that used to have coordinates \fIx\fR and \fIy\fR will have new
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
.PP
.CS
\fIx\(fm\fR = \fIoriginX\fR + \fIscaleX\fR \(mu (\fIx\fR \(mi \fIoriginX\fR)
\fIy\(fm\fR = \fIoriginY\fR + \fIscaleY\fR \(mu (\fIy\fR \(mi \fIoriginY\fR)
.CE
.PP
\fIscaleProc\fR must also update the bounding box in the item's
header.
.SS TRANSLATEPROC
.PP
\fItypePtr\->translateProc\fR is invoked by Tk to translate a canvas item
during the \fBmove\fR widget command.
The procedure must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemTranslateProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        double \fIdeltaX\fR,
        double \fIdeltaY\fR);
.CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning,
and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be
added to each x and y coordinate within the item.
The type manager should adjust the item's coordinates and
update the bounding box in the item's header.
.SS INDEXPROC
.PP
\fItypePtr\->indexProc\fR is invoked by Tk to translate a string
index specification into a numerical index, for example during the
\fBindex\fR widget command.
It is only relevant for item types that support indexable text or coordinates;
\fItypePtr\->indexProc\fR may be specified as NULL for non-textual
item types if they do not support detailed coordinate addressing.
The procedure must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemIndexProc\fR(
        Tcl_Interp *\fIinterp\fR,
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        Tcl_Obj *\fIindexObj\fR,
        int *\fIindexPtr\fR);
.CE
.PP
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all
have the usual meaning.
\fIindexObj\fR contains a textual description of an index,
and \fIindexPtr\fR points to an integer value that should be
filled in with a numerical index.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will
actually contain a pointer to a constant string.
It is up to the type manager to decide what forms of index
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
\fBend\fR, etc.).
\fIindexProc\fR should return a Tcl completion code and set
the interpreter result in the event of an error.
.SS ICURSORPROC
.PP
\fItypePtr\->icursorProc\fR is invoked by Tk during
the \fBicursor\fR widget command to set the position of the
insertion cursor in a textual item.
It is only relevant for item types that support an insertion cursor;
\fItypePtr\->icursorProc\fR may be specified as NULL for item types
that do not support an insertion cursor.
The procedure must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemCursorProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIindex\fR);
.CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and
\fIindex\fR is an index into the item's text, as returned by a
previous call to \fItypePtr\->insertProc\fR.
The type manager should position the insertion cursor in the
item just before the character given by \fIindex\fR.
Whether or not to actually display the insertion cursor is
determined by other information provided by \fBTk_CanvasGetTextInfo\fR.
.SS SELECTIONPROC
.PP
\fItypePtr\->selectionProc\fR is invoked by Tk during selection
retrievals; it must return part or all of the selected text in
the item (if any).
It is only relevant for item types that support text;
\fItypePtr\->selectionProc\fR may be specified as NULL for non-textual
item types.
The procedure must match the following prototype:
.PP
.CS
typedef int \fBTk_ItemSelectionProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIoffset\fR,
        char *\fIbuffer\fR,
        int \fImaxBytes\fR);
.CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIoffset\fR is an offset in bytes into the selection where 0 refers
to the first byte of the selection; it identifies
the first character that is to be returned in this call.
\fIbuffer\fR points to an area of memory in which to store the
requested bytes, and \fImaxBytes\fR specifies the maximum number
of bytes to return.
\fIselectionProc\fR should extract up to \fImaxBytes\fR characters
from the selection and copy them to \fImaxBytes\fR; it should
return a count of the number of bytes actually copied, which may
be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
in the selection.
.SS INSERTPROC
.PP
\fItypePtr\->insertProc\fR is invoked by Tk during
the \fBinsert\fR widget command to insert new text or coordinates into a
canvas item.
It is only relevant for item types that support the \fBinsert\fR method;
\fItypePtr\->insertProc\fR may be specified as NULL for other
item types.
The procedure must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemInsertProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIindex\fR,
        Tcl_Obj *\fIobj\fR);
.CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIindex\fR is an index into the item's text, as returned by a
previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR
contains new text to insert just before the character given
by \fIindex\fR.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will
actually contain a pointer to a constant string to be inserted.
If the item supports modification of the coordinates list by this
.PP
The type manager should insert the text and recompute the bounding
box in the item's header.
.SS DCHARSPROC
.PP
\fItypePtr\->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
widget command to delete a range of text from a canvas item or a range of
coordinates from a pathed item.
It is only relevant for item types that support text;
\fItypePtr\->dCharsProc\fR may be specified as NULL for non-textual
item types that do not want to support coordinate deletion.
The procedure must match the following prototype:
.PP
.CS
typedef void \fBTk_ItemDCharsProc\fR(
        Tk_Canvas \fIcanvas\fR,
        Tk_Item *\fIitemPtr\fR,
        int \fIfirst\fR,
        int \fIlast\fR);
.CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIfirst\fR and \fIlast\fR give the indices of the first and last bytes
to be deleted, as returned by previous calls to \fItypePtr\->indexProc\fR.
The type manager should delete the specified characters and update
the bounding box in the item's header.
.SH "SEE ALSO"
Tk_CanvasPsY, Tk_CanvasTextInfo, Tk_CanvasTkwin
.SH KEYWORDS
canvas, focus, item type, selection, type manager
@


1.15
log
@A few const -> CONST86 modifications, improving
backwards compatibility. Change Tk_ItemIndexProc
and Tk_ItemInsertProc signature to have a Tcl_Obj parameter
in stead of a string parameter. This is binary
and source compatible with previous API, it just prevents
the need for a type cast in the Tk_ItemType table construction.
Bring doc in line with API.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.14 2008/11/01 17:26:36 dkf Exp $
d71 1
a71 1
    Tk_ConfigSpec *\fIconfigSpecs\fR;
@


1.14
log
@Cleanup and document TK_MOVABLE_POINTS
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.13 2008/06/30 22:57:01 dkf Exp $
d68 1
a68 1
    char *\fIname\fR;
d283 1
a283 1
The \fIinterp\fR objument identifies the interpreter in which the
d569 1
a569 1
        char *\fIindexString\fR,
d575 1
a575 1
\fIindexString\fR contains a textual description of an index,
d578 3
a580 3
Note that if \fBTK_CONFIG_OBJS\fR is set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIindexString\fR parameter will
actually contain a Tcl_Obj reference.
d656 1
a656 1
        char *\fIstring\fR);
d661 1
a661 1
previous call to \fItypePtr\->insertProc\fR, and \fIstring\fR
d664 3
a666 3
Note that if \fBTK_CONFIG_OBJS\fR is set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIstring\fR parameter will
actually contain a Tcl_Obj reference to the string to insert.
@


1.13
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.12 2007/12/13 15:23:42 dgp Exp $
d49 1
a49 1
bitmap (file tkCanvBmap.c) or text (tkCanvText.c).
d65 1
d98 1
a98 1
allocated or dynamically allocated but never freed);  Tk retains
d108 1
a108 1
defined by Tk via the type Tk_Item;  the rest of the item
d113 1
d125 1
d135 1
a135 1
canvas coordinates:  the item should not cover any pixels
d145 1
a145 1
The argument is always passed as a pointer to a Tk_Item;  the type
d150 1
a150 1
Tk_Canvas;  it serves as an opaque handle for the canvas widget
d158 1
d169 28
d199 1
a199 1
\fItypePtr->itemSize\fR gives the size in bytes of item records
d208 1
a208 1
\fItypePtr->createProc\fR points to a procedure for
d210 2
a211 1
\fItypePtr->createProc\fR must match the following prototype:
d218 1
a218 1
        Tcl_Obj* const \fIobjv\fR[]);
d220 1
d225 1
a225 1
size \fItypePtr->itemSize\fR.
d231 5
a235 1
For example, in the widget command
d239 1
d247 1
a247 1
error message in \fIinterp->result\fR if an error occurs.
d257 2
a258 2
This table will normally be used by \fItypePtr->createProc\fR
and \fItypePtr->configProc\fR, but Tk also uses it directly
d261 1
a261 1
\fItypePtr->configSpecs\fR must point to the configuration table
d264 1
a264 1
for implementing the \fB\-tags\fR option;  see an existing type
d268 1
a268 1
\fItypePtr->configProc\fR is called by Tk whenever the
d272 1
d279 1
a279 1
        Tcl_Obj* const \fIobjv\fR[],
d282 1
d284 1
a284 1
widget command was invoked,  \fIcanvas\fR is a handle for the canvas
d286 6
a291 2
\fIobjc\fR and \fIobjv\fR contain the configuration options.  For
example, if the following command is invoked:
d295 1
d299 1
a299 1
The  \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
d301 1
a301 1
invokes \fItypePtr->configProc\fR, but the type manager's \fIcreateProc\fR
d304 2
a305 2
\fItypePtr->configProc\fR returns a standard Tcl completion code and
leaves an error message in \fIinterp->result\fR if an error occurs.
d310 1
a310 1
\fItypePtr->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
d313 1
d320 1
a320 1
        Tcl_Obj* const \fIobjv\fR[]);
d322 1
d326 3
d330 1
d334 1
d343 1
a343 1
\fIinterp->result\fR.
d346 1
a346 1
\fItypePtr->deleteProc\fR is invoked by Tk to delete an item
d349 1
d356 1
d362 1
a362 1
\fIdeleteProc\fR should not actually free the item record;  this will
d364 1
a364 1
.SS "DISPLAYPROC AND ALWAYSREDRAW"
d366 1
a366 1
\fItypePtr->displayProc\fR is invoked by Tk to redraw an item
d369 1
d381 1
d403 7
a409 6
However, if \fItypePtr->alwaysRedraw\fR has a non-zero value, then
\fIdisplayProc\fR is invoked during every redisplay operation,
even if the item does not overlap the area of redisplay.
\fIalwaysRedraw\fR should normally be set to 0;  it is only
set to 1 in special cases such as window items that need to be
unmapped when they are off-screen.
d412 1
a412 1
\fItypePtr->pointProc\fR is invoked by Tk to find out how close
d417 1
d424 1
d433 1
a433 1
\fItypePtr->areaProc\fR is invoked by Tk to find out the relationship
d436 1
d443 1
d454 1
a454 1
\fItypePtr->postscriptProc\fR is invoked by Tk to generate
d457 1
a457 1
\fItypePtr->postscriptProc\fR should be NULL.
d459 1
d467 1
d469 1
a469 1
standard meanings;  \fIprepass\fR will be described below.
d471 1
a471 1
Postscript for the item to the information in \fIinterp->result\fR
d475 1
a475 1
and replace its contents with an error message;  then it should
d497 1
a497 1
(which is done by \fBTk_CanvasPsFont\fR);  the actual Postscript is
d500 1
a500 1
during the first pass;  the type manager can use \fIprepass\fR to skip
d506 1
a506 1
\fItypePtr->scaleProc\fR is invoked by Tk to rescale a canvas item
d509 1
d519 1
d527 1
d529 2
a530 2
\fIx\(fm = originX  + scaleX*(x-originX)
y\(fm = originY + scaleY*(y-originY)\fR
d532 1
d537 1
a537 1
\fItypePtr->translateProc\fR is invoked by Tk to translate a canvas item
d540 1
d548 1
d556 1
a556 1
\fItypePtr->indexProc\fR is invoked by Tk to translate a string
d559 3
a561 3
It is only relevant for item types that support indexable text;
\fItypePtr->indexProc\fR may be specified as NULL for non-textual
item types.
d563 1
d569 1
a569 1
        char \fIindexString\fR,
d572 1
d578 3
d582 1
a582 1
are supported (e.g., numbers, \fBinsert\fR,  \fBsel.first\fR,
d585 1
a585 1
\fIinterp->result\fR in the event of an error.
d588 1
a588 1
\fItypePtr->icursorProc\fR is invoked by Tk during
d592 1
a592 1
\fItypePtr->icursorProc\fR may be specified as NULL for item types
d595 1
d602 1
d605 1
a605 1
previous call to \fItypePtr->insertProc\fR.
d612 2
a613 2
\fItypePtr->selectionProc\fR is invoked by Tk during selection
retrievals;  it must return part or all of the selected text in
d616 1
a616 1
\fItypePtr->selectionProc\fR may be specified as NULL for non-textual
d619 1
d628 1
d631 1
a631 1
to the first byte of the selection;  it identifies
d637 1
a637 1
from the selection and copy them to \fImaxBytes\fR;  it should
d643 2
a644 2
\fItypePtr->insertProc\fR is invoked by Tk during
the \fBinsert\fR widget command to insert new text into a
d646 2
a647 2
It is only relevant for item types that support text;
\fItypePtr->insertProc\fR may be specified as NULL for non-textual
d650 1
d658 1
d661 1
a661 1
previous call to \fItypePtr->insertProc\fR, and \fIstring\fR
d664 5
d673 3
a675 2
\fItypePtr->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
widget command to delete a range of text from a canvas item.
d677 2
a678 2
\fItypePtr->dCharsProc\fR may be specified as NULL for non-textual
item types.
d680 1
d688 1
d691 1
a691 1
to be deleted, as returned by previous calls to \fItypePtr->indexProc\fR.
@


1.12
log
@merge stable branch onto HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.10.2.1 2007/11/01 16:37:12 dgp Exp $
d87 1
a87 1
} Tk_ItemType;
d121 1
a121 1
} BitmapItem;
d166 1
d180 6
a185 6
typedef int Tk_ItemCreateProc(
    Tcl_Interp *\fIinterp\fR,
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIobjc\fR,
    Tcl_Obj* const \fIobjv\fR[]);
d234 7
a240 7
typedef int Tk_ItemConfigureProc(
    Tcl_Interp *\fIinterp\fR,
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIobjc\fR,
    Tcl_Obj* const \fIobjv\fR[],
    int \fIflags\fR);
d268 6
a273 6
typedef int Tk_ItemCoordProc(
    Tcl_Interp *\fIinterp\fR,
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIobjc\fR,
    Tcl_Obj* const \fIobjv\fR[]);
d297 4
a300 4
typedef void Tk_ItemDeleteProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    Display *\fIdisplay\fR);
d315 9
a323 9
typedef void Tk_ItemDisplayProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    Display *\fIdisplay\fR,
    Drawable \fIdst\fR,
    int \fIx\fR,
    int \fIy\fR,
    int \fIwidth\fR,
    int \fIheight\fR);
d360 4
a363 4
typedef double Tk_ItemPointProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    double *\fIpointPtr\fR);
d377 4
a380 4
typedef int Tk_ItemAreaProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    double *\fIrectPtr\fR);
d398 5
a402 5
typedef int Tk_ItemPostscriptProc(
    Tcl_Interp *\fIinterp\fR,
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIprepass\fR);
d441 1
d446 7
a452 7
typedef void Tk_ItemScaleProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    double \fIoriginX\fR,
    double \fIoriginY\fR,
    double \fIscaleX\fR,
    double \fIscaleY\fR);
d468 1
d473 5
a477 5
typedef void Tk_ItemTranslateProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    double \fIdeltaX\fR,
    double \fIdeltaY\fR);
d485 1
d494 6
a499 6
typedef int Tk_ItemIndexProc(
    Tcl_Interp *\fIinterp\fR,
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    char \fIindexString\fR,
    int *\fIindexPtr\fR);
d521 4
a524 4
typedef void Tk_ItemCursorProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIindex\fR);
d543 6
a548 6
typedef int Tk_ItemSelectionProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIoffset\fR,
    char *\fIbuffer\fR,
    int \fImaxBytes\fR);
d572 5
a576 5
typedef void Tk_ItemInsertProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIindex\fR,
    char *\fIstring\fR);
d594 5
a598 5
typedef void Tk_ItemDCharsProc(
    Tk_Canvas \fIcanvas\fR,
    Tk_Item *\fIitemPtr\fR,
    int \fIfirst\fR,
    int \fIlast\fR);
@


1.11
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.10 2007/01/05 00:00:48 nijtmans Exp $
@


1.10
log
@various "const" additions, in line with TIP #27
fix bug #1627732
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.9 2005/08/17 06:20:25 georgeps Exp $
a26 1

a55 1

d155 1
a155 2

.SH NAME
d165 1
a165 2

.SH ITEMSIZE
d173 1
a173 2

.SH CREATEPROC
d212 1
a212 2

.SH CONFIGSPECS
d226 1
a226 2

.SH CONFIGPROC
d261 1
a261 2

.SH COORDPROC
d290 1
a290 2

.SH DELETEPROC
d308 1
a308 2

.SH "DISPLAYPROC AND ALWAYSREDRAW"
d347 1
a347 1
even if the item doesn't overlap the area of redisplay.
d351 1
a351 2

.SH POINTPROC
d370 1
a370 2

.SH AREAPROC
d389 1
a389 2

.SH POSTSCRIPTPROC
d439 1
a439 2

.SH SCALEPROC
d458 1
a458 1
coordinates \fIx'\fR and \fIy'\fR, where
d460 2
a461 2
\fIx' = originX  + scaleX*(x-originX)
y' = originY + scaleY*(y-originY)\fR
d465 1
a465 2

.SH TRANSLATEPROC
d481 1
a481 2

.SH INDEXPROC
d507 1
a507 2

.SH ICURSORPROC
d514 1
a514 1
that don't support an insertion cursor.
d529 1
a529 2

.SH SELECTIONPROC
d556 1
a556 1
be less than \fImaxBytes\fR if there aren't \fIoffset+maxBytes\fR bytes
d558 1
a558 2

.SH INSERTPROC
d581 1
a581 2

.SH DCHARSPROC
a600 1

a602 1

@


1.10.2.1
log
@merge updates from HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.10 2007/01/05 00:00:48 nijtmans Exp $
d27 1
d57 1
d157 2
a158 1
.SS NAME
d168 2
a169 1
.SS ITEMSIZE
d177 2
a178 1
.SS CREATEPROC
d217 2
a218 1
.SS CONFIGSPECS
d232 2
a233 1
.SS CONFIGPROC
d268 2
a269 1
.SS COORDPROC
d298 2
a299 1
.SS DELETEPROC
d317 2
a318 1
.SS "DISPLAYPROC AND ALWAYSREDRAW"
d357 1
a357 1
even if the item does not overlap the area of redisplay.
d361 2
a362 1
.SS POINTPROC
d381 2
a382 1
.SS AREAPROC
d401 2
a402 1
.SS POSTSCRIPTPROC
d452 2
a453 1
.SS SCALEPROC
d472 1
a472 1
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
d474 2
a475 2
\fIx\(fm = originX  + scaleX*(x-originX)
y\(fm = originY + scaleY*(y-originY)\fR
d479 2
a480 1
.SS TRANSLATEPROC
d496 2
a497 1
.SS INDEXPROC
d523 2
a524 1
.SS ICURSORPROC
d531 1
a531 1
that do not support an insertion cursor.
d546 2
a547 1
.SS SELECTIONPROC
d574 1
a574 1
be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
d576 2
a577 1
.SS INSERTPROC
d600 2
a601 1
.SS DCHARSPROC
d621 1
d624 1
@


1.9
log
@Fixed missing [] in prototypes that have objv.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.8 2004/09/19 16:05:36 dkf Exp $
d189 1
a189 1
    Tcl_Obj* CONST \fIobjv\fR[]);
d245 1
a245 1
    Tcl_Obj* CONST \fIobjv\fR[],
d280 1
a280 1
    Tcl_Obj* CONST \fIobjv\fR[]);
@


1.8
log
@Standardize style of section refs & public symbols. Remove displayed tabs
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.7 2004/08/22 15:43:20 dkf Exp $
d189 1
a189 1
    Tcl_Obj* CONST \fIobjv\fR);
d245 1
a245 1
    Tcl_Obj* CONST \fIobjv\fR,
d280 1
a280 1
    Tcl_Obj* CONST \fIobjv\fR);
@


1.7
log
@More doc fixes from Mikhail Kolesnitchenko. [Patch 1013520]
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.6 2000/07/25 21:14:34 jenglish Exp $
d69 20
a88 20
	char *\fIname\fR;
	int \fIitemSize\fR;
	Tk_ItemCreateProc *\fIcreateProc\fR;
	Tk_ConfigSpec *\fIconfigSpecs\fR;
	Tk_ItemConfigureProc *\fIconfigProc\fR;
	Tk_ItemCoordProc *\fIcoordProc\fR;
	Tk_ItemDeleteProc *\fIdeleteProc\fR;
	Tk_ItemDisplayProc *\fIdisplayProc\fR;
	int \fIalwaysRedraw\fR;
	Tk_ItemPointProc *\fIpointProc\fR;
	Tk_ItemAreaProc *\fIareaProc\fR;
	Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
	Tk_ItemScaleProc *\fIscaleProc\fR;
	Tk_ItemTranslateProc *\fItranslateProc\fR;
	Tk_ItemIndexProc *\fIindexProc\fR;
	Tk_ItemCursorProc *\fIicursorProc\fR;
	Tk_ItemSelectionProc *\fIselectionProc\fR;
	Tk_ItemInsertProc *\fIinsertProc\fR;
	Tk_ItemDCharsProc *\fIdCharsProc\fR;
	Tk_ItemType *\fInextPtr\fR;
d116 7
a122 7
	Tk_Item \fIheader\fR;
	double \fIx\fR, \fIy\fR;
	Tk_Anchor \fIanchor\fR;
	Pixmap \fIbitmap\fR;
	XColor *\fIfgColor\fR;
	XColor *\fIbgColor\fR;
	GC \fIgc\fR;
d185 5
a189 5
	Tcl_Interp *\fIinterp\fR,
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIobjc\fR,
	Tcl_Obj* CONST \fIobjv\fR);
d241 6
a246 6
	Tcl_Interp *\fIinterp\fR,
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIobjc\fR,
	Tcl_Obj* CONST \fIobjv\fR,
	int \fIflags\fR);
d260 1
a260 1
currently this value is always TK_CONFIG_ARGV_ONLY when Tk
d276 5
a280 5
	Tcl_Interp *\fIinterp\fR,
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIobjc\fR,
	Tcl_Obj* CONST \fIobjv\fR);
d306 3
a308 3
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	Display *\fIdisplay\fR);
d325 8
a332 8
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	Display *\fIdisplay\fR,
	Drawable \fIdst\fR,
	int \fIx\fR,
	int \fIy\fR,
	int \fIwidth\fR,
	int \fIheight\fR);
d371 3
a373 3
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	double *\fIpointPtr\fR);
d389 3
a391 3
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	double *\fIrectPtr\fR);
d411 4
a414 4
	Tcl_Interp *\fIinterp\fR,
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIprepass\fR);
d421 1
a421 1
and return TCL_OK.
d424 1
a424 1
return TCL_ERROR.
d459 6
a464 6
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	double \fIoriginX\fR,
	double \fIoriginY\fR,
	double \fIscaleX\fR,
	double \fIscaleY\fR);
d486 4
a489 4
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	double \fIdeltaX\fR,
	double \fIdeltaY\fR);
d507 5
a511 5
	Tcl_Interp *\fIinterp\fR,
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	char \fIindexString\fR,
	int *\fIindexPtr\fR);
d535 3
a537 3
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIindex\fR);
d558 5
a562 5
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIoffset\fR,
	char *\fIbuffer\fR,
	int \fImaxBytes\fR);
d588 4
a591 4
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIindex\fR,
	char *\fIstring\fR);
d611 4
a614 4
	Tk_Canvas \fIcanvas\fR,
	Tk_Item *\fIitemPtr\fR,
	int \fIfirst\fR,
	int \fIlast\fR);
@


1.6
log
@CanvPsY.3, ConfigWidg.3, CrtImgType.3, CrtItemType.3,
FontId.3, GetFont.3, canvas.n, font.n, options.n, text.n:
Documentation fix: Replaced references to XFontStruct *
and Tk_FontStruct with Tk_Font.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.5 2000/03/02 21:53:00 hobbs Exp $
d405 1
a405 1
Postcript for an item during the \fBpostscript\fR widget command.
@


1.5
log
@	* doc/CrtItemType.3: fixed docs for Tk_CreateItemType to reflect
	changes made in 8.3.0 (but old style would still work as well).
	[Bug: 4252]
	* doc/entry.n: improved docs discussing caveats and gotchas when
	mixing textvar with widget validation
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.4 1999/04/21 21:53:20 rjohnson Exp $
d534 1
a534 1
typedef void Tk_ItemIndexProc(
@


1.5.2.1
log
@doc cleanup and clarifications from 8.4aCVS backport
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.6 2000/07/25 21:14:34 jenglish Exp $
d534 1
a534 1
typedef void Tk_ItemCursorProc(
@


1.4
log
@
Merged 8-1-0 into mainline.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.3 1999/04/16 18:26:12 surles Exp $
d188 2
a189 2
	int \fIargc\fR,
	char **\fIargv\fR);
d198 1
a198 1
The \fIargc\fR and \fIargv\fR arguments describe all of the
d205 2
a206 2
\fIargc\fR will be \fB6\fR and \fIargv\fR[0] will contain the
string \fB10\fR.
d208 1
a208 1
\fIcreateProc\fR should use \fIargc\fR and \fIargv\fR to initialize
d244 2
a245 2
	int \fIargc\fR,
	char **\fIargv\fR,
d248 1
a248 1
The \fIinterp\fR argument identifies the interpreter in which the
d251 1
a251 1
\fIargc\fR and \fIargv\fR contain the configuration options.  For
d256 1
a256 1
\fIargc\fR is \fB4\fR and \fIargv\fR contains the strings \fB\-fill\fR
d258 1
a258 1
\fIargc\fR will always be an even value.
d279 2
a280 2
	int \fIargc\fR,
	char **\fIargv\fR);
d283 1
a283 1
all have the standard meanings, and \fIargc\fR and \fIargv\fR
d289 1
a289 1
\fIargc\fR will be \fB2\fR and \fBargv\fR will contain the string values
@


1.3
log
@fixed Tk doc bugs
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.2 1998/09/14 18:22:47 stanton Exp $
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id$
d445 1
a445 1
(which is done by \fBTk_CanvPsFont\fR);  the actual Postscript is
@


1.2.8.1
log
@
Merged with mainline.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.3 1999/04/16 18:26:12 surles Exp $
d445 1
a445 1
(which is done by \fBTk_CanvasPsFont\fR);  the actual Postscript is
@


1.1
log
@Initial revision
@
text
@d7 1
a7 1
'\" SCCS: @@(#) CrtItemType.3 1.7 96/02/16 10:30:28
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: CrtItemType.3,v 1.2 1998/09/14 18:22:47 stanton Exp $
@


