From 601277bddb0a4d871b8ab90e88b5d7dfde3ec2a3 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 15 Mar 2018 10:15:10 +1100 Subject: Use forward class definitions of XPM and RGBAImage so only code that uses them needs to #include "XPM.h". Move definition of standard methods on LineMarker from header to implementation to reduce included text and further isolate use of XPM and RGBAImage. --- src/LineMarker.cxx | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/LineMarker.cxx') diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 261916e11..820ab9fae 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -24,6 +24,45 @@ using namespace Scintilla; +LineMarker::~LineMarker() { +} + +LineMarker::LineMarker() { + markType = SC_MARK_CIRCLE; + fore = ColourDesired(0, 0, 0); + back = ColourDesired(0xff, 0xff, 0xff); + backSelected = ColourDesired(0xff, 0x00, 0x00); + alpha = SC_ALPHA_NOALPHA; + customDraw = nullptr; +} + +LineMarker::LineMarker(const LineMarker &) { + // Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor. + markType = SC_MARK_CIRCLE; + fore = ColourDesired(0, 0, 0); + back = ColourDesired(0xff, 0xff, 0xff); + backSelected = ColourDesired(0xff, 0x00, 0x00); + alpha = SC_ALPHA_NOALPHA; + pxpm.reset(); + image.reset(); + customDraw = nullptr; +} + +LineMarker &LineMarker::operator=(const LineMarker &other) { + // Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator. + if (this != &other) { + markType = SC_MARK_CIRCLE; + fore = ColourDesired(0, 0, 0); + back = ColourDesired(0xff, 0xff, 0xff); + backSelected = ColourDesired(0xff, 0x00, 0x00); + alpha = SC_ALPHA_NOALPHA; + pxpm.reset(); + image.reset(); + customDraw = nullptr; + } + return *this; +} + void LineMarker::SetXPM(const char *textForm) { pxpm = std::make_unique(textForm); markType = SC_MARK_PIXMAP; -- cgit v1.2.3