# Copyright (c) 1994-1996 Sun Microsystems, Inc. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # =head1 NAME Tk_CanvasTextInfo - additional information for managing text items in canvases =for category C Programming =head1 SYNOPSIS B<#include Etk.hE> Tk_CanvasTextInfo * B(I) =head1 ARGUMENTS =over 4 =item Tk_Canvas canvas (in) A token that identifies a particular canvas widget. =back =head1 DESCRIPTION Textual canvas items are somewhat more complicated to manage than other items, due to things like the selection and the input focus. B may be invoked by a type manager to obtain additional information needed for items that display text. The return value from B is a pointer to a structure that is shared between Tk and all the items that display text. The structure has the following form: typedef struct Tk_CanvasTextInfo { Tk_3DBorder selBorder; int selBorderWidth; XColor *selFgColorPtr; Tk_Item *selItemPtr; int selectFirst; int selectLast; Tk_Item *anchorItemPtr; int selectAnchor; Tk_3DBorder insertBorder; int insertWidth; int insertBorderWidth; Tk_Item *focusItemPtr; int gotFocus; int cursorOn; } Tk_CanvasTextInfo; The B field identifies a Tk_3DBorder that should be used for drawing the background under selected text. I gives the width of the raised border around selected text, in pixels. I points to an XColor that describes the foreground color to be used when drawing selected text. I points to the item that is currently selected, or NULL if there is no item selected or if the canvas doesn't have the selection. I and I give the indices of the first and last selected characters in I, as returned by the I for that item. I points to the item that currently has the selection anchor; this is not necessarily the same as I. I is an index that identifies the anchor position within I. I contains a Tk_3DBorder to use when drawing the insertion cursor; I gives the total width of the insertion cursor in pixels, and I gives the width of the raised border around the insertion cursor. I identifies the item that currently has the input focus, or NULL if there is no such item. I is 1 if the canvas widget has the input focus and 0 otherwise. I is 1 if the insertion cursor should be drawn in I and 0 if it should not be drawn; this field is toggled on and off by Tk to make the cursor blink. The structure returned by B is shared between Tk and the type managers; typically the type manager calls B once when an item is created and then saves the pointer in the item's record. Tk will update information in the Tk_CanvasTextInfo; for example, a B method might change the I field, or a B