aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt/ScintillaEditBase
diff options
context:
space:
mode:
Diffstat (limited to 'qt/ScintillaEditBase')
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp143
-rw-r--r--qt/ScintillaEditBase/PlatQt.h29
2 files changed, 0 insertions, 172 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp
index 9510efa92..16f699e8e 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -156,8 +156,6 @@ std::shared_ptr<Font> Font::Allocate(const FontParameters &fp)
}
SurfaceImpl::SurfaceImpl()
-: device(nullptr), painter(nullptr), deviceOwned(false), painterOwned(false), x(0), y(0),
- codecName(nullptr), codec(nullptr)
{}
SurfaceImpl::SurfaceImpl(int width, int height, SurfaceMode mode_)
@@ -201,20 +199,6 @@ void SurfaceImpl::Init(SurfaceID sid, WindowID /*wid*/)
device = static_cast<QPaintDevice *>(sid);
}
-void SurfaceImpl::InitPixMap(int width,
- int height,
- Surface *surface,
- WindowID /*wid*/)
-{
- Release();
- if (width < 1) width = 1;
- if (height < 1) height = 1;
- deviceOwned = true;
- device = new QPixmap(width, height);
- SurfaceImpl *psurfOther = dynamic_cast<SurfaceImpl *>(surface);
- mode = psurfOther->mode;
-}
-
std::unique_ptr<Surface> SurfaceImpl::AllocatePixMap(int width, int height)
{
return std::make_unique<SurfaceImpl>(width, height, mode);
@@ -244,13 +228,6 @@ bool SurfaceImpl::Initialised()
return device != nullptr;
}
-void SurfaceImpl::PenColour(ColourDesired fore)
-{
- QPen penOutline(QColorFromCA(fore));
- penOutline.setCapStyle(Qt::FlatCap);
- GetPainter()->setPen(penOutline);
-}
-
void SurfaceImpl::PenColour(ColourAlpha fore)
{
QPen penOutline(QColorFromColourAlpha(fore));
@@ -266,11 +243,6 @@ void SurfaceImpl::PenColourWidth(ColourAlpha fore, XYPOSITION strokeWidth) {
GetPainter()->setPen(penOutline);
}
-void SurfaceImpl::BrushColour(ColourDesired back)
-{
- GetPainter()->setBrush(QBrush(QColorFromCA(back)));
-}
-
void SurfaceImpl::BrushColour(ColourAlpha back)
{
GetPainter()->setBrush(QBrush(QColorFromColourAlpha(back)));
@@ -315,20 +287,6 @@ int SurfaceImpl::DeviceHeightFont(int points)
return points;
}
-void SurfaceImpl::MoveTo(int x_, int y_)
-{
- x = x_;
- y = y_;
-}
-
-void SurfaceImpl::LineTo(int x_, int y_)
-{
- QLineF line(x, y, x_, y_);
- GetPainter()->drawLine(line);
- x = x_;
- y = y_;
-}
-
void SurfaceImpl::LineDraw(Point start, Point end, Stroke stroke)
{
PenColourWidth(stroke.colour, stroke.width);
@@ -345,22 +303,6 @@ void SurfaceImpl::PolyLine(const Point *pts, size_t npts, Stroke stroke)
GetPainter()->drawPolyline(&qpts[0], static_cast<int>(npts));
}
-void SurfaceImpl::Polygon(Point *pts,
- size_t npts,
- ColourDesired fore,
- ColourDesired back)
-{
- PenColour(fore);
- BrushColour(back);
-
- std::vector<QPoint> qpts(npts);
- for (size_t i = 0; i < npts; i++) {
- qpts[i] = QPoint(pts[i].x, pts[i].y);
- }
-
- GetPainter()->drawPolygon(&qpts[0], static_cast<int>(npts));
-}
-
void SurfaceImpl::Polygon(const Point *pts, size_t npts, FillStroke fillStroke)
{
PenColourWidth(fillStroke.stroke.colour, fillStroke.stroke.width);
@@ -372,16 +314,6 @@ void SurfaceImpl::Polygon(const Point *pts, size_t npts, FillStroke fillStroke)
GetPainter()->drawPolygon(&qpts[0], static_cast<int>(npts));
}
-void SurfaceImpl::RectangleDraw(PRectangle rc,
- ColourDesired fore,
- ColourDesired back)
-{
- PenColour(fore);
- BrushColour(back);
- QRectF rect(rc.left, rc.top, rc.Width() - 1, rc.Height() - 1);
- GetPainter()->drawRect(rect);
-}
-
void SurfaceImpl::RectangleDraw(PRectangle rc, FillStroke fillStroke)
{
PenColourWidth(fillStroke.stroke.colour, fillStroke.stroke.width);
@@ -398,11 +330,6 @@ void SurfaceImpl::RectangleFrame(PRectangle rc, Stroke stroke) {
GetPainter()->drawRect(rect);
}
-void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back)
-{
- GetPainter()->fillRect(QRectFFromPRect(rc), QColorFromCA(back));
-}
-
void SurfaceImpl::FillRectangle(PRectangle rc, Fill fill)
{
GetPainter()->fillRect(QRectFFromPRect(rc), QColorFromColourAlpha(fill.colour));
@@ -432,15 +359,6 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern)
}
}
-void SurfaceImpl::RoundedRectangle(PRectangle rc,
- ColourDesired fore,
- ColourDesired back)
-{
- PenColour(fore);
- BrushColour(back);
- GetPainter()->drawRoundedRect(QRectFFromPRect(RectangleInset(rc, 0.5f)), 3.0f, 3.0f);
-}
-
void SurfaceImpl::RoundedRectangle(PRectangle rc, FillStroke fillStroke)
{
PenColourWidth(fillStroke.stroke.colour, fillStroke.stroke.width);
@@ -448,44 +366,6 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, FillStroke fillStroke)
GetPainter()->drawRoundedRect(QRectFFromPRect(rc), 3.0f, 3.0f);
}
-void SurfaceImpl::AlphaRectangle(PRectangle rc,
- int cornerSize,
- ColourDesired fill,
- int alphaFill,
- ColourDesired outline,
- int alphaOutline,
- int /*flags*/)
-{
- const QColor qFill = QColorFromColourAlpha(ColourAlpha(fill, alphaFill));
- const QBrush brushFill(qFill);
- GetPainter()->setBrush(brushFill);
-
- if ((fill == outline) && (alphaFill == alphaOutline)) {
- painter->setPen(Qt::NoPen);
- const QRectF rect = QRectFFromPRect(rc);
- if (cornerSize > 0.0f) {
- // A radius of 1 shows no curve so add 1
- qreal radius = cornerSize+1;
- GetPainter()->drawRoundedRect(rect, radius, radius);
- } else {
- GetPainter()->fillRect(rect, brushFill);
- }
- } else {
- const QColor qOutline = QColorFromColourAlpha(ColourAlpha(outline, alphaOutline));
- const QPen penOutline(qOutline);
- GetPainter()->setPen(penOutline);
-
- const QRectF rect(rc.left, rc.top, rc.Width() - 1.5, rc.Height() - 1.5);
- if (cornerSize > 0.0f) {
- // A radius of 1 shows no curve so add 1
- qreal radius = cornerSize+1;
- GetPainter()->drawRoundedRect(rect, radius, radius);
- } else {
- GetPainter()->drawRect(rect);
- }
- }
-}
-
void SurfaceImpl::AlphaRectangle(PRectangle rc, XYPOSITION cornerSize, FillStroke fillStroke)
{
QColor qFill = QColorFromColourAlpha(fillStroke.fill.colour);
@@ -556,15 +436,6 @@ void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsi
GetPainter()->drawImage(pt, image);
}
-void SurfaceImpl::Ellipse(PRectangle rc,
- ColourDesired fore,
- ColourDesired back)
-{
- PenColour(fore);
- BrushColour(back);
- GetPainter()->drawEllipse(QRectFFromPRect(rc));
-}
-
void SurfaceImpl::Ellipse(PRectangle rc, FillStroke fillStroke)
{
PenColourWidth(fillStroke.stroke.colour, fillStroke.stroke.width);
@@ -878,20 +749,6 @@ void SurfaceImpl::FlushCachedState()
}
}
-void SurfaceImpl::SetUnicodeMode(bool unicodeMode_)
-{
- mode.codePage = unicodeMode_ ? SC_CP_UTF8 : 0;
-}
-
-void SurfaceImpl::SetDBCSMode(int codePage_)
-{
- mode.codePage = codePage_;
-}
-
-void SurfaceImpl::SetBidiR2L(bool)
-{
-}
-
void SurfaceImpl::FlushDrawing()
{
}
diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h
index c9424378e..898078f75 100644
--- a/qt/ScintillaEditBase/PlatQt.h
+++ b/qt/ScintillaEditBase/PlatQt.h
@@ -31,12 +31,6 @@ namespace Scintilla {
const char *CharacterSetID(int characterSet);
-inline QColor QColorFromCA(ColourDesired ca)
-{
- long c = ca.AsInteger();
- return QColor(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
-}
-
inline QColor QColorFromColourAlpha(ColourAlpha ca)
{
return QColor(ca.GetRed(), ca.GetGreen(), ca.GetBlue(), ca.GetAlpha());
@@ -77,8 +71,6 @@ private:
QPainter *painter = nullptr;
bool deviceOwned = false;
bool painterOwned = false;
- float x = 0;
- float y = 0;
SurfaceMode mode;
const char *codecName = nullptr;
QTextCodec *codec = nullptr;
@@ -92,8 +84,6 @@ public:
void Init(WindowID wid) override;
void Init(SurfaceID sid, WindowID wid) override;
- void InitPixMap(int width, int height,
- Surface *surface, WindowID wid) override;
std::unique_ptr<Surface> AllocatePixMap(int width, int height) override;
void SetMode(SurfaceMode mode) override;
@@ -101,38 +91,24 @@ public:
void Release() noexcept override;
int Supports(int feature) noexcept override;
bool Initialised() override;
- void PenColour(ColourDesired fore) override;
void PenColour(ColourAlpha fore);
void PenColourWidth(ColourAlpha fore, XYPOSITION strokeWidth);
int LogPixelsY() override;
int PixelDivisions() override;
int DeviceHeightFont(int points) override;
- void MoveTo(int x_, int y_) override;
- void LineTo(int x_, int y_) override;
void LineDraw(Point start, Point end, Stroke stroke) override;
void PolyLine(const Point *pts, size_t npts, Stroke stroke) override;
- void Polygon(Point *pts, size_t npts, ColourDesired fore,
- ColourDesired back) override;
void Polygon(const Point *pts, size_t npts, FillStroke fillStroke) override;
- void RectangleDraw(PRectangle rc, ColourDesired fore,
- ColourDesired back) override;
void RectangleDraw(PRectangle rc, FillStroke fillStroke) override;
void RectangleFrame(PRectangle rc, Stroke stroke) override;
- void FillRectangle(PRectangle rc, ColourDesired back) override;
void FillRectangle(PRectangle rc, Fill fill) override;
void FillRectangleAligned(PRectangle rc, Fill fill) override;
void FillRectangle(PRectangle rc, Surface &surfacePattern) override;
- void RoundedRectangle(PRectangle rc, ColourDesired fore,
- ColourDesired back) override;
void RoundedRectangle(PRectangle rc, FillStroke fillStroke) override;
- void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill,
- int alphaFill, ColourDesired outline, int alphaOutline, int flags) override;
void AlphaRectangle(PRectangle rc, XYPOSITION cornerSize, FillStroke fillStroke) override;
void GradientRectangle(PRectangle rc, const std::vector<ColourStop> &stops, GradientOptions options) override;
void DrawRGBAImage(PRectangle rc, int width, int height,
const unsigned char *pixelsImage) override;
- void Ellipse(PRectangle rc, ColourDesired fore,
- ColourDesired back) override;
void Ellipse(PRectangle rc, FillStroke fillStroke) override;
void Stadium(PRectangle rc, FillStroke fillStroke, Ends ends) override;
void Copy(PRectangle rc, Point from, Surface &surfaceSource) override;
@@ -170,11 +146,6 @@ public:
void FlushCachedState() override;
void FlushDrawing() override;
- void SetUnicodeMode(bool unicodeMode_) override;
- void SetDBCSMode(int codePage_) override;
- void SetBidiR2L(bool bidiR2L_) override;
-
- void BrushColour(ColourDesired back);
void BrushColour(ColourAlpha back);
void SetCodec(const Font *font);
void SetFont(const Font *font);