diff options
| -rw-r--r-- | gtk/PlatGTK.cxx | 14 | ||||
| -rw-r--r-- | include/Platform.h | 7 | ||||
| -rw-r--r-- | src/CallTip.cxx | 6 | ||||
| -rw-r--r-- | src/Editor.cxx | 6 | 
4 files changed, 17 insertions, 16 deletions
| diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index dd05e54a3..34a33f581 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -242,7 +242,7 @@ public:  	void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back);  	void Copy(PRectangle rc, Point from, Surface &surfaceSource); -	void DrawText(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); +	void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back);  	void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back);  	void MeasureWidths(Font &font_, const char *s, int len, int *positions);  	int WidthText(Font &font_, const char *s, int len); @@ -456,7 +456,7 @@ void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource) {  	}  } -void SurfaceImpl::DrawText(PRectangle rc, Font &font_, int ybase, const char *s, int len, +void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len,                         ColourAllocated fore, ColourAllocated back) {  	FillRectangle(rc, back);  	PenColour(fore); @@ -464,7 +464,7 @@ void SurfaceImpl::DrawText(PRectangle rc, Font &font_, int ybase, const char *s,  		gdk_draw_text(drawable, PFont(font_), gc, rc.left, ybase, s, len);  } -// On GTK+, exactly same as DrawText +// On GTK+, exactly same as DrawTextNoClip  void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len,                                ColourAllocated fore, ColourAllocated back) {  	FillRectangle(rc, back); @@ -500,10 +500,6 @@ int SurfaceImpl::WidthChar(Font &font_, char ch) {  		return 1;  } -Surface *Surface::Allocate() { -	return new SurfaceImpl; -} -  // Three possible strategies for determining ascent and descent of font:  // 1) Call gdk_string_extents with string containing all letters, numbers and punctuation.  // 2) Use the ascent and descent fields of GdkFont. @@ -591,6 +587,10 @@ void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) {  	unicodeMode=unicodeMode_;  } +Surface *Surface::Allocate() { +	return new SurfaceImpl; +} +  Window::~Window() {}  void Window::Destroy() { diff --git a/include/Platform.h b/include/Platform.h index 0beede070..5281260c4 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -199,10 +199,11 @@ class Palette {  #if PLAT_GTK  	void *allocatedPalette; // GdkColor *  	int allocatedLen; -#elif PLAT_WIN -	void *hpal;  #endif  public: +#if PLAT_WIN +	void *hpal; +#endif  	bool allowRealization;  	Palette(); @@ -277,7 +278,7 @@ public:  	virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;  	virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; -	virtual void DrawText(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0; +	virtual void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0;  	virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0;  	virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions)=0;  	virtual int WidthText(Font &font_, const char *s, int len)=0; diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 807b745f6..4e075cf23 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -81,7 +81,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {  		rcClient.left = x;  		rcClient.top = ytext - ascent - 1;  		rcClient.right = xEnd; -		surfaceWindow->DrawText(rcClient, font, ytext, +		surfaceWindow->DrawTextNoClip(rcClient, font, ytext,  		                        chunkVal, thisStartHighlight,  		                        colourUnSel.allocated, colourBG.allocated);  		x = xEnd; @@ -91,7 +91,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {  		rcClient.top = ytext;  		rcClient.left = x;  		rcClient.right = xEnd; -		surfaceWindow->DrawText(rcClient, font, ytext, +		surfaceWindow->DrawTextNoClip(rcClient, font, ytext,  		                        chunkVal + thisStartHighlight, thisEndHighlight - thisStartHighlight,  		                        colourSel.allocated, colourBG.allocated);  		x = xEnd; @@ -100,7 +100,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {  		                                    chunkLength - thisEndHighlight);  		rcClient.left = x;  		rcClient.right = xEnd; -		surfaceWindow->DrawText(rcClient, font, ytext, +		surfaceWindow->DrawTextNoClip(rcClient, font, ytext,  		                        chunkVal + thisEndHighlight, chunkLength - thisEndHighlight,  		                        colourUnSel.allocated, colourBG.allocated);  		chunkVal = chunkEnd + 1; diff --git a/src/Editor.cxx b/src/Editor.cxx index 039306a41..a39e7096f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -876,7 +876,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {  					int xpos = rcNumber.right - width - 3;  					rcNumber.left = xpos;  					if ((visibleLine < cs.LinesDisplayed()) && cs.GetVisible(line)) { -						surface->DrawText(rcNumber, vs.styles[STYLE_LINENUMBER].font, +						surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,  						                  rcNumber.top + vs.maxAscent, number, strlen(number),  						                  vs.styles[STYLE_LINENUMBER].fore.allocated,  						                  vs.styles[STYLE_LINENUMBER].back.allocated); @@ -1152,7 +1152,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis  				// Only try to draw if really visible - enhances performance by not calling environment to  				// draw strings that are completely past the right side of the window.  				if (rcSegment.left <= rcLine.right) { -					surface->DrawText(rcSegment, textFont, +					surface->DrawTextNoClip(rcSegment, textFont,  					                  rcSegment.top + vsDraw.maxAscent, ll.chars + startseg,  					                  i - startseg + 1, textFore, textBack);  					if (vsDraw.viewWhitespace != wsInvisible || @@ -1665,7 +1665,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {  				// Right justify  				rcNumber.left -=  				    surface->WidthText(vsPrint.styles[STYLE_LINENUMBER].font, number, strlen(number)); -				surface->DrawText(rcNumber, vsPrint.styles[STYLE_LINENUMBER].font, +				surface->DrawTextNoClip(rcNumber, vsPrint.styles[STYLE_LINENUMBER].font,  				                  ypos + vsPrint.maxAscent, number, strlen(number),  				                  vsPrint.styles[STYLE_LINENUMBER].fore.allocated,  				                  vsPrint.styles[STYLE_LINENUMBER].back.allocated); | 
