summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Display.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Text_Display.cxx')
-rw-r--r--src/Fl_Text_Display.cxx124
1 files changed, 0 insertions, 124 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 4a9817998..d5380c3c3 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -223,133 +223,9 @@ void Fl_Text_Display::highlight_data(Fl_Text_Buffer *styleBuffer,
mHighlightCBArg = cbArg;
mStyleBuffer->canUndo(0);
-#if 0
- // FIXME: this is in nedit code -- is it needed?
- /* Call TextDSetFont to combine font information from style table and
- primary font, adjust font-related parameters, and then redisplay */
- TextDSetFont(textD, textD->fontStruct);
-#endif
damage(FL_DAMAGE_EXPOSE);
}
-#if 0
- // FIXME: this is in nedit code -- is it needed?
-/**
- Change the (non highlight) font
-*/
-void TextDSetFont(textDisp *textD, XFontStruct *fontStruct) {
- Display *display = XtDisplay(textD->w);
- int i, maxAscent = fontStruct->ascent, maxDescent = fontStruct->descent;
- int width, height, fontWidth;
- Pixel bgPixel, fgPixel, selectFGPixel, selectBGPixel;
- Pixel highlightFGPixel, highlightBGPixel;
- XGCValues values;
- XFontStruct *styleFont;
-
- /* If font size changes, cursor will be redrawn in a new position */
- blankCursorProtrusions(textD);
-
- /* If there is a (syntax highlighting) style table in use, find the new
- maximum font height for this text display */
- for (i=0; i<textD->nStyles; i++) {
- styleFont = textD->styleTable[i].font;
- if (styleFont != NULL && styleFont->ascent > maxAscent)
- maxAscent = styleFont->ascent;
- if (styleFont != NULL && styleFont->descent > maxDescent)
- maxDescent = styleFont->descent;
- }
- textD->ascent = maxAscent;
- textD->descent = maxDescent;
-
- /* If all of the current fonts are fixed and match in width, compute */
- fontWidth = fontStruct->max_bounds.width;
- if (fontWidth != fontStruct->min_bounds.width)
- fontWidth = -1;
- else {
- for (i=0; i<textD->nStyles; i++) {
- styleFont = textD->styleTable[i].font;
- if (styleFont != NULL && (styleFont->max_bounds.width != fontWidth ||
- styleFont->max_bounds.width != styleFont->min_bounds.width))
- fontWidth = -1;
- }
- }
- textD->fixedFontWidth = fontWidth;
-
- /* Don't let the height dip below one line, or bad things can happen */
- if (textD->height < maxAscent + maxDescent)
- textD->height = maxAscent + maxDescent;
-
- /* Change the font. In most cases, this means re-allocating the
- affected GCs (they are shared with other widgets, and if the primary
- font changes, must be re-allocated to change it). Unfortunately,
- this requres recovering all of the colors from the existing GCs */
- textD->fontStruct = fontStruct;
- XGetGCValues(display, textD->gc, GCForeground|GCBackground, &values);
- fgPixel = values.foreground;
- bgPixel = values.background;
- XGetGCValues(display, textD->selectGC, GCForeground|GCBackground, &values);
- selectFGPixel = values.foreground;
- selectBGPixel = values.background;
- XGetGCValues(display, textD->highlightGC,GCForeground|GCBackground,&values);
- highlightFGPixel = values.foreground;
- highlightBGPixel = values.background;
- releaseGC(textD->w, textD->gc);
- releaseGC(textD->w, textD->selectGC);
- releaseGC(textD->w, textD->highlightGC);
- releaseGC(textD->w, textD->selectBGGC);
- releaseGC(textD->w, textD->highlightBGGC);
- if (textD->lineNumGC != NULL)
- releaseGC(textD->w, textD->lineNumGC);
- textD->lineNumGC = NULL;
- allocateFixedFontGCs(textD, fontStruct, bgPixel, fgPixel, selectFGPixel,
- selectBGPixel, highlightFGPixel, highlightBGPixel);
- XSetFont(display, textD->styleGC, fontStruct->fid);
-
- /* Do a full resize to force recalculation of font related parameters */
- width = textD->width;
- height = textD->height;
- textD->width = textD->height = 0;
- TextDResize(textD, width, height);
-
- /* Redisplay */
- TextDRedisplayRect(textD, textD->left, textD->top, textD->width,
- textD->height);
-
- /* Clean up line number area in case spacing has changed */
- draw_line_numbers(textD, True);
-}
-
-int TextDMinFontWidth(textDisp *textD, Boolean considerStyles) {
- int fontWidth = textD->fontStruct->max_bounds.width;
- int i;
-
- if (considerStyles) {
- for (i = 0; i < textD->nStyles; ++i) {
- int thisWidth = (textD->styleTable[i].font)->min_bounds.width;
- if (thisWidth < fontWidth) {
- fontWidth = thisWidth;
- }
- }
- }
- return(fontWidth);
-}
-
-int TextDMaxFontWidth(textDisp *textD, Boolean considerStyles) {
- int fontWidth = textD->fontStruct->max_bounds.width;
- int i;
-
- if (considerStyles) {
- for (i = 0; i < textD->nStyles; ++i) {
- int thisWidth = (textD->styleTable[i].font)->max_bounds.width;
- if (thisWidth > fontWidth) {
- fontWidth = thisWidth;
- }
- }
- }
- return(fontWidth);
-}
-#endif
-
int Fl_Text_Display::longest_vline() const {
int longest = 0;
for (int i = 0; i < mNVisibleLines; i++)