1 // Scintilla source code edit control 2 /** @file MarginView.h 3 ** Defines the appearance of the editor margin. 4 **/ 5 // Copyright 1998-2014 by Neil Hodgson <[email protected]> 6 // The License.txt file describes the conditions under which this software may be distributed. 7 8 #ifndef MARGINVIEW_H 9 #define MARGINVIEW_H 10 11 namespace Scintilla { 12 13 void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour); 14 15 typedef void (*DrawWrapMarkerFn)(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour); 16 17 /** 18 * MarginView draws the margins. 19 */ 20 class MarginView { 21 public: 22 std::unique_ptr<Surface> pixmapSelMargin; 23 std::unique_ptr<Surface> pixmapSelPattern; 24 std::unique_ptr<Surface> pixmapSelPatternOffset1; 25 // Highlight current folding block 26 HighlightDelimiter highlightDelimiter; 27 28 int wrapMarkerPaddingRight; // right-most pixel padding of wrap markers 29 /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native 30 * DrawWrapMarker function for drawing wrap markers. Allow those platforms to 31 * override it instead of creating a new method in the Surface class that 32 * existing platforms must implement as empty. */ 33 DrawWrapMarkerFn customDrawWrapMarker; 34 35 MarginView() noexcept; 36 37 void DropGraphics(bool freeObjects); 38 void AllocateGraphics(const ViewStyle &vsDraw); 39 void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw); 40 void PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin, 41 const EditModel &model, const ViewStyle &vs); 42 }; 43 44 } 45 46 #endif 47