| 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 <neilh@scintilla.org> |
| 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::Internal { |
| 12 | |
| 13 | void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourRGBA wrapColour); |
| 14 | |
| 15 | typedef void (*DrawWrapMarkerFn)(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourRGBA 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() noexcept; |
| 38 | void RefreshPixMaps(Surface *surfaceWindow, const ViewStyle &vsDraw); |
| 39 | void PaintOneMargin(Surface *surface, PRectangle rc, PRectangle rcOneMargin, const MarginStyle &marginStyle, |
| 40 | const EditModel &model, const ViewStyle &vs); |
| 41 | void PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin, |
| 42 | const EditModel &model, const ViewStyle &vs); |
| 43 | }; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | #endif |
| 48 | |