diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-10-25 21:06:25 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-10-25 21:06:25 (GMT) |
| commit | 0d5336db012f45753abace489f18f0ca299c6961 (patch) | |
| tree | b1bf3280a9046df99226158978502eeb26f5b0a3 /generic/tkText.h | |
| parent | e97381a6d921de403516d5b761539a450f4af83c (diff) | |
| parent | 1320b8a2a9c1269a345d44d673a7a35707fbbe9c (diff) | |
| download | tk-core-tip-626.zip tk-core-tip-626.tar.gz tk-core-tip-626.tar.bz2 | |
Merge 9.0core-tip-626
Diffstat (limited to 'generic/tkText.h')
| -rw-r--r-- | generic/tkText.h | 191 |
1 files changed, 81 insertions, 110 deletions
diff --git a/generic/tkText.h b/generic/tkText.h index e29a8ac..63bf6c6 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -114,12 +114,16 @@ typedef struct TkTextEmbWindow { * yet. */ TkTextLine *linePtr; /* Line structure that contains this * window. */ - char *create; /* Script to create window on-demand. NULL - * means no such script. Malloc-ed. */ + Tcl_Obj *createObj; /* Script to create window on-demand. NULL + * means no such script. */ +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *padXObj, *padYObj; /* Padding to leave around each side of window. */ +#endif TkAlignMode align; /* How to align window in vertical space. See * definitions in tkTextWind.c. */ - int padX, padY; /* Padding to leave around each side of - * window, in pixels. */ +#if TK_MAJOR_VERSION < 9 + int padX, padY; +#endif int stretch; /* Should window stretch to fill vertical * space of line (except for pady)? 0 or 1. */ Tk_OptionTable optionTable; /* Token representing the configuration @@ -140,18 +144,23 @@ typedef struct TkTextEmbImage { * text widget. This is used when the image * changes or is deleted. */ TkTextLine *linePtr; /* Line structure that contains this image. */ - char *imageString; /* Name of the image for this segment. */ - char *imageName; /* Name used by text widget to identify this + Tcl_Obj *imageObj; /* Name of the image for this segment. */ + Tcl_Obj *imageNameObj; /* Name used by text widget to identify this * image. May be unique-ified. */ char *name; /* Name used in the hash table. Used by * "image names" to identify this instance of * the image. */ Tk_Image image; /* Image for this segment. NULL means that the * image hasn't been created yet. */ +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *padXObj, *padYObj; /* Padding to leave around each side of image, + * in pixels. */ +#endif TkAlignMode align; /* How to align image in vertical space. See * definitions in tkTextImage.c. */ - int padX, padY; /* Padding to leave around each side of image, - * in pixels. */ +#if TK_MAJOR_VERSION < 9 + int padX, padY; +#endif int chunkCount; /* Number of display chunks that refer to this * image. */ Tk_OptionTable optionTable; /* Token representing the configuration @@ -211,7 +220,7 @@ typedef struct TkTextIndex { typedef struct TkTextDispChunk TkTextDispChunk; -typedef void Tk_ChunkDisplayProc(struct TkText *textPtr, +typedef void Tk_ChunkDisplayProc(struct TkText *textPtr, TkTextDispChunk *chunkPtr, int x, int y, int height, int baseline, Display *display, Drawable dst, int screenY); @@ -343,12 +352,7 @@ typedef struct TkTextTag { Tk_3DBorder border; /* Used for drawing background. NULL means no * value specified here. */ - int borderWidth; /* Width of 3-D border for background. */ - Tcl_Obj *borderWidthPtr; /* Width of 3-D border for background. */ -#if TK_MAJOR_VERSION < 9 - char *reliefString; /* -relief option string (malloc-ed). NULL - * means option not specified. */ -#endif + Tcl_Obj *borderWidthObj; /* Width of 3-D border for background. */ int relief; /* 3-D relief for background. */ Pixmap bgStipple; /* Stipple bitmap for background. None means * no value specified here. */ @@ -359,118 +363,68 @@ typedef struct TkTextTag { Pixmap fgStipple; /* Stipple bitmap for text and other * foreground stuff. None means no value * specified here.*/ -#if TK_MAJOR_VERSION < 9 - char *justifyString; /* -justify option string (malloc-ed). NULL - * means option not specified. */ -#endif Tk_Justify justify; /* How to justify text: TK_JUSTIFY_CENTER, * TK_JUSTIFY_LEFT, or TK_JUSTIFY_RIGHT. */ -#if TK_MAJOR_VERSION > 8 - Tcl_Obj *lMargin1Obj; /* -lmargin1 option object. NULL - * means option not specified. */ -#else - char *lMargin1String; /* -lmargin1 option string (malloc-ed). NULL - * means option not specified. */ -#endif - int lMargin1; /* Left margin for first display line of each - * text line, in pixels. INT_MIN means option not specified. */ -#if TK_MAJOR_VERSION > 8 - Tcl_Obj *lMargin2Obj; /* -lmargin2 option object. NULL - * means option not specified. */ -#else - char *lMargin2String; /* -lmargin2 option string (malloc-ed). NULL - * means option not specified. */ -#endif - int lMargin2; /* Left margin for second and later display lines - * of each text line, in pixels. INT_MIN means option not specified. */ + Tcl_Obj *lMargin1Obj; /* Left margin for first display line of each + * text line, in pixels. NULL means option not specified. */ + int lMargin1; /* No longer used, but kept for binary compatibility. */ + Tcl_Obj *lMargin2Obj; /* Left margin for second and later display lines + * of each text line, in pixels NULL means option not specified. */ + int lMargin2; /* No longer used, but kept for binary compatibility. */ Tk_3DBorder lMarginColor; /* Used for drawing background in left margins. - * This is used for both lmargin1 and lmargin2. + * This is used for both lmargin1 and lmargin2. * NULL means no value specified here. */ -#if TK_MAJOR_VERSION > 8 - Tcl_Obj *offsetObj; /* -offset option. NULL means option not specified. */ -#else - char *offsetString; /* -offset option string (malloc-ed). NULL - * means option not specified. */ -#endif - int offset; /* Vertical offset of text's baseline from + Tcl_Obj *offsetObj; /* Vertical offset of text's baseline from * baseline of line. Used for superscripts and - * subscripts. INT_MIN means option not specified. */ + * subscripts. NULL means option not specified. */ + int offset; /* No longer used, but kept for binary compatibility. */ #if TK_MAJOR_VERSION < 9 - char *overstrikeString; /* -overstrike option string (malloc-ed). NULL + Tcl_Obj *overstrikeObj; /* -overstrike option. NULL * means option not specified. */ #endif int overstrike; /* > 0 means draw horizontal line through * middle of text. -1 means not specified. */ XColor *overstrikeColor; /* Color for the overstrike. NULL means same - * color as foreground. */ -#if TK_MAJOR_VERSION > 8 - Tcl_Obj *rMarginObj; /* -rmargin option object. NULL - * means option not specified. */ -#else - char *rMarginString; /* -rmargin option string (malloc-ed). NULL + * color as foreground. */ + Tcl_Obj *rMarginObj; /* Right margin for text, in pixels. NULL * means option not specified. */ -#endif - int rMargin; /* Right margin for text, in pixels. INT_MIN means option not specified. */ + int rMargin; /* No longer used, but kept for binary compatibility. */ Tk_3DBorder rMarginColor; /* Used for drawing background in right margin. * NULL means no value specified here. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ -#if TK_MAJOR_VERSION > 8 Tcl_Obj *spacing1Obj; /* -spacing1 option object. NULL * means option not specified. */ -#else - char *spacing1String; /* -spacing1 option string (malloc-ed). NULL - * means option not specified. */ -#endif - int spacing1; /* Extra spacing above first display line for - * text line. INT_MIN means option not specified. */ -#if TK_MAJOR_VERSION > 8 Tcl_Obj *spacing2Obj; /* -spacing2 option object. NULL * means option not specified. */ -#else - char *spacing2String; /* -spacing2 option string (malloc-ed). NULL - * means option not specified. */ -#endif - int spacing2; /* Extra spacing between display lines for the - * same text line. INT_MIN means option not specified. */ -#if TK_MAJOR_VERSION > 8 Tcl_Obj *spacing3Obj; /* -spacing3 option object. NULL * means option not specified. */ -#else - char *spacing3String; /* -spacing3 option string (malloc-ed). NULL - * means option not specified. */ -#endif - int spacing3; /* Extra spacing below last display line for - * text line. INT_MIN means option not specified. */ - Tcl_Obj *tabStringPtr; /* -tabs option string. NULL means option not + Tcl_Obj *tabStringPtr; /* -tabs option. NULL means option not * specified. */ struct TkTextTabArray *tabArrayPtr; /* Info about tabs for tag (malloc-ed) or - * NULL. Corresponds to tabString. */ -#if TK_MAJOR_VERSION > 8 + * NULL. Corresponds to tabStringPtr. */ TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR * or TK_TEXT_TABSTYLE_NULL (if not specified). */ -#else - int tabStyle; /* One of TABULAR or WORDPROCESSOR or NONE (if - * not specified). */ - char *underlineString; /* -underline option string (malloc-ed). NULL +#if TK_MAJOR_VERSION < 9 + Tcl_Obj *underlineObj; /* -underline option. NULL * means option not specified. */ #endif int underline; /* > 0 means draw underline underneath * text. -1 means not specified. */ XColor *underlineColor; /* Color for the underline. NULL means same - * color as foreground. */ + * color as foreground. */ TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * Must be TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD, * TEXT_WRAPMODE_NONE, or TEXT_WRAPMODE_NULL to * use wrapmode for whole widget. */ #if TK_MAJOR_VERSION < 9 - char *elideString; /* -elide option string (malloc-ed). NULL + Tcl_Obj *elideObj; /* -elide option. NULL * means option not specified. */ #endif - int elide; /* > 0 means that data under this tag + int elide; /* Non-zero means that data under this tag * should not be displayed. -1 means not specified. */ int affectsDisplay; /* Non-zero means that this tag affects the * way information is displayed on the screen @@ -647,7 +601,7 @@ typedef struct TkSharedText { struct TkText *peers; Tcl_Size undoMarkId; /* Counts undo marks temporarily used during - undo and redo operations. */ + undo and redo operations. */ } TkSharedText; /* @@ -709,14 +663,23 @@ typedef struct TkText { Tk_3DBorder border; /* Structure used to draw 3-D border and * default background. */ - int borderWidth; /* Width of 3-D border to draw around entire +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *borderWidthObj; /* Width of 3-D border to draw around entire * widget. */ - int padX, padY; /* Padding between text and window border. */ + Tcl_Obj *padXObj, *padYObj; /* Padding between text and window border. */ +#else + int borderWidth; + int padX, padY; +#endif int relief; /* 3-d effect for border around entire widget: * TK_RELIEF_RAISED etc. */ - int highlightWidth; /* Width in pixels of highlight to draw around +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw around * widget when it has the focus. <= 0 means * don't draw a highlight. */ +#else + int highlightWidth; +#endif XColor *highlightBgColorPtr; /* Color for drawing traversal highlight area * when highlight is off. */ @@ -728,13 +691,17 @@ typedef struct TkText { * font. */ int charHeight; /* Height of average character in default * font, including line spacing. */ - int spacing1; /* Default extra spacing above first display +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *spacing1Obj; /* Default extra spacing above first display * line for each text line. */ - int spacing2; /* Default extra spacing between display lines + Tcl_Obj *spacing2Obj; /* Default extra spacing between display lines * for the same text line. */ - int spacing3; /* Default extra spacing below last display + Tcl_Obj *spacing3Obj; /* Default extra spacing below last display * line for each text line. */ - Tcl_Obj *tabOptionPtr; /* Value of -tabs option string. */ +#else + int spacing1, spacing2, spacing3; +#endif + Tcl_Obj *tabOptionObj; /* Value of -tabs option string. */ TkTextTabArray *tabArrayPtr; /* Information about tab stops (malloc'ed). * NULL means perform default tabbing @@ -749,8 +716,12 @@ typedef struct TkText { * TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_NONE, or * TEXT_WRAPMODE_WORD, or TEXT_WRAPMODE_NULL to * use wrapmode for whole widget. */ - int width, height; /* Desired dimensions for window, measured in - * characters. */ + int width; /* Desired dimensions for window, measured in characters */ +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *heightObj; +#else + int height; +#endif int setGrid; /* Non-zero means pass gridding information to * window manager. */ int prevWidth, prevHeight; /* Last known dimensions of window; used to @@ -773,8 +744,10 @@ typedef struct TkText { /* Border and background for selected * characters when they don't have the * focus. */ - int selBorderWidth; /* Width of border around selection. */ - Tcl_Obj *selBorderWidthPtr; /* Width of border around selection. */ +#if TK_MAJOR_VERSION < 8 + int selBorderWidth; +#endif + Tcl_Obj *selBorderWidthObj; /* Width of border around selection. */ XColor *selFgColorPtr; /* Foreground color for selected text. This is * a copy of information in *selTagPtr, so it * shouldn't be explicitly freed. */ @@ -793,8 +766,12 @@ typedef struct TkText { /* Points to segment for "insert" mark. */ Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion * cursor. */ - int insertWidth; /* Total width of insert cursor. */ - int insertBorderWidth; /* Width of 3-D border around insert cursor */ +#if TK_MAJOR_VERSION > 8 + Tcl_Obj *insertWidthObj; /* Total width of insert cursor. */ + Tcl_Obj *insertBorderWidthObj; /* Width of 3-D border around insert cursor */ +#else + int insertWidth, insertBorderWidth; +#endif TkTextInsertUnfocussed insertUnfocussed; /* How to display the insert cursor when the * text widget does not have the focus. */ @@ -825,19 +802,13 @@ typedef struct TkText { * Miscellaneous additional information: */ -#if TK_MAJOR_VERSION > 8 Tcl_Obj *takeFocusObj; /* Value of -takeFocus option; not used in the * C code, but used by keyboard traversal - * scripts. Malloc'ed, but may be NULL. */ + * scripts. May be NULL. */ Tcl_Obj *xScrollCmdObj; /* Prefix of command to issue to update - * horizontal scrollbar when view changes. */ + * horizontal scrollbar when view changes. May be NULL. */ Tcl_Obj *yScrollCmdObj; /* Prefix of command to issue to update - * vertical scrollbar when view changes. */ -#else - char *takeFocus; - char *xScrollCmd; - char *yScrollCmd; -#endif + * vertical scrollbar when view changes. May be NULL. */ int flags; /* Miscellaneous flags; see below for * definitions. */ Tk_OptionTable optionTable; /* Token representing the configuration @@ -860,7 +831,7 @@ typedef struct TkText { int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to - * date */ + * date */ } TkText; /* |
