diff options
author | fvogel <fvogelnew1@free.fr> | 2016-03-08 21:55:45 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-03-08 21:55:45 (GMT) |
commit | 938a781fc060670163d405d5a24f516587b37161 (patch) | |
tree | 7de22d5cfbf55e327ae057cdba5d0e2bf5f68f04 | |
parent | f1f3a0f357ee3900438c2522d48f28bb4bcd3aa6 (diff) | |
download | tk-938a781fc060670163d405d5a24f516587b37161.zip tk-938a781fc060670163d405d5a24f516587b37161.tar.gz tk-938a781fc060670163d405d5a24f516587b37161.tar.bz2 |
Backed out anything dealing with stippling, in accordance with discussion about TIP #443
-rw-r--r-- | doc/text.n | 16 | ||||
-rw-r--r-- | generic/tkText.c | 2 | ||||
-rw-r--r-- | generic/tkText.h | 5 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 20 | ||||
-rw-r--r-- | generic/tkTextTag.c | 8 | ||||
-rw-r--r-- | tests/textTag.test | 24 |
6 files changed, 5 insertions, 70 deletions
@@ -548,22 +548,6 @@ items. It may have any of the forms accepted by \fBTk_GetColor\fR. If string, then the color specified by the \fB\-background\fR tag option is used. .TP -\fB\-selectbgstipple \fIbitmap\fR -. -\fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the -selected background. It may have any of the forms accepted by -\fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is -specified as an empty string, then the bitmap specified by -\fB\-bgstipple\fR will be used for the background. -.TP -\fB\-selectfgstipple \fIbitmap\fR -. -\fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing -selected text and other foreground information such as underlines. It may have any of -the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been -specified, or if it is specified as an empty string, then the bitmap specified by -\fB\-fgstipple\fR will be used. -.TP \fB\-selectforeground \fIcolor\fR \fIColor\fR specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If diff --git a/generic/tkText.c b/generic/tkText.c index 0de648a..88fe19a 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2288,11 +2288,9 @@ ConfigureText( || (textPtr->selTagPtr->selBorder != NULL) || (textPtr->selTagPtr->reliefString != NULL) || (textPtr->selTagPtr->bgStipple != None) - || (textPtr->selTagPtr->selBgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) - || (textPtr->selTagPtr->selFgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) || (textPtr->selTagPtr->overstrikeColor != NULL) || (textPtr->selTagPtr->underlineString != NULL) diff --git a/generic/tkText.h b/generic/tkText.h index f37e01a..5d88784 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -371,13 +371,8 @@ typedef struct TkTextTag { * NULL means no value specified here. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ - Pixmap selBgStipple; /* Stipple bitmap for background of selected text. - * None means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ - Pixmap selFgStipple; /* Stipple bitmap for text and other - * foreground stuff when selected. None means - * no value specified here.*/ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d22bcb3..0849307 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -818,15 +818,11 @@ GetStyle( for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; - Pixmap bgStipple; XColor *fgColor; - Pixmap fgStipple; tagPtr = tagPtrs[i]; border = tagPtr->border; - bgStipple = tagPtr->bgStipple; fgColor = tagPtr->fgColor; - fgStipple = tagPtr->fgStipple; /* * If this is the selection tag, and inactiveSelBorder is NULL (the @@ -850,18 +846,10 @@ GetStyle( border = tagPtr->selBorder; } - if ((tagPtr->selBgStipple != None) && (isSelected)) { - bgStipple = tagPtr->selBgStipple; - } - if ((tagPtr->selFgColor != None) && (isSelected)) { fgColor = tagPtr->selFgColor; } - if ((tagPtr->selFgStipple != None) && (isSelected)) { - bgStipple = tagPtr->selFgStipple; - } - if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; @@ -880,9 +868,9 @@ GetStyle( styleValues.relief = tagPtr->relief; reliefPrio = tagPtr->priority; } - if ((bgStipple != None) + if ((tagPtr->bgStipple != None) && (tagPtr->priority > bgStipplePrio)) { - styleValues.bgStipple = bgStipple; + styleValues.bgStipple = tagPtr->bgStipple; bgStipplePrio = tagPtr->priority; } if ((fgColor != None) && (tagPtr->priority > fgPrio)) { @@ -893,9 +881,9 @@ GetStyle( styleValues.tkfont = tagPtr->tkfont; fontPrio = tagPtr->priority; } - if ((fgStipple != None) + if ((tagPtr->fgStipple != None) && (tagPtr->priority > fgStipplePrio)) { - styleValues.fgStipple = fgStipple; + styleValues.fgStipple = tagPtr->fgStipple; fgStipplePrio = tagPtr->priority; } if ((tagPtr->justifyString != NULL) diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 49d6a50..a212615 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -79,10 +79,6 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_BITMAP, "-selectbgstipple", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, selBgStipple), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_BITMAP, "-selectfgstipple", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, selFgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, @@ -538,11 +534,9 @@ TkTextTagCmd( || (tagPtr->selBorder != NULL) || (tagPtr->reliefString != NULL) || (tagPtr->bgStipple != None) - || (tagPtr->selBgStipple != None) || (tagPtr->fgColor != NULL) || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) - || (tagPtr->selFgStipple != None) || (tagPtr->overstrikeString != NULL) || (tagPtr->overstrikeColor != NULL) || (tagPtr->underlineString != NULL) @@ -1055,9 +1049,7 @@ TkTextCreateTag( tagPtr->rMargin = 0; tagPtr->rMarginColor = NULL; tagPtr->selBorder = NULL; - tagPtr->selBgStipple = None; tagPtr->selFgColor = NULL; - tagPtr->selFgStipple = None; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; tagPtr->spacing2String = NULL; diff --git a/tests/textTag.test b/tests/textTag.test index f8d7033..88081d0 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -273,34 +273,12 @@ test textTag-1.25d {configuration options} -body { .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] } -returnCodes error -result {unknown color name "non-existent"} test textTag-1.25e {tag configuration options} -body { - .t tag configure x -selectbgstipple gray50 - .t tag cget x -selectbgstipple -} -cleanup { - .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] -} -result {gray50} -test textTag-1.25f {configuration options} -body { - .t tag configure x -selectbgstipple badStipple -} -cleanup { - .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] -} -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.25g {tag configuration options} -body { - .t tag configure x -selectfgstipple gray50 - .t tag cget x -selectfgstipple -} -cleanup { - .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] -} -result {gray50} -test textTag-1.25h {configuration options} -body { - .t tag configure x -selectfgstipple badStipple -} -cleanup { - .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] -} -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.25i {tag configuration options} -body { .t tag configure x -selectforeground #012345 .t tag cget x -selectforeground } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] } -result {#012345} -test textTag-1.25j {configuration options} -body { +test textTag-1.25f {configuration options} -body { .t tag configure x -selectforeground non-existent } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] |