diff options
author | Neil <nyamatongwe@gmail.com> | 2017-06-12 11:49:56 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-06-12 11:49:56 +1000 |
commit | 46f9fd7509eaa2809392acf3a264b57a2daf973c (patch) | |
tree | 1e3ee8a900c4e4c7768abbe21bfa9acc4043b345 /qt/ScintillaEditBase/PlatQt.cpp | |
parent | 09972b3a179d7ea39ef6ce7e0474531797c549fb (diff) | |
download | scintilla-mirror-46f9fd7509eaa2809392acf3a264b57a2daf973c.tar.gz |
Removed unused functions and methods from Platform.h.
Replaced Platform::Clamp with Sci::clamp but will later change this to
std::clamp once on full C++17 compilers.
Drop MouseButtonBounce workaround for very early GTK+/Linux.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 106 |
1 files changed, 2 insertions, 104 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 4c7eba127..e288cf5bf 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -10,6 +10,7 @@ #include "PlatQt.h" #include "Scintilla.h" +#include "DBCS.h" #include "FontQuality.h" #include <QApplication> @@ -489,7 +490,7 @@ void SurfaceImpl::MeasureWidths(Font &font, // DBCS int ui = 0; for (int i=0; i<len;) { - size_t lenChar = Platform::IsDBCSLeadByte(codePage, s[i]) ? 2 : 1; + size_t lenChar = DBCSIsLeadByte(codePage, s[i]) ? 2 : 1; qreal xPosition = tl.cursorToX(ui+1); for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) { positions[i++] = xPosition; @@ -539,12 +540,6 @@ XYPOSITION SurfaceImpl::InternalLeading(Font & /* font */) return 0; } -XYPOSITION SurfaceImpl::ExternalLeading(Font &font) -{ - QFontMetricsF metrics(*FontPointer(font), device); - return metrics.leading(); -} - XYPOSITION SurfaceImpl::Height(Font &font) { QFontMetricsF metrics(*FontPointer(font), device); @@ -625,11 +620,6 @@ void Window::Destroy() wid = 0; } -bool Window::HasFocus() -{ - return wid ? window(wid)->hasFocus() : false; -} - PRectangle Window::GetPosition() { // Before any size allocated pretend its 1000 wide so not scrolled @@ -725,12 +715,6 @@ void Window::SetCursor(Cursor curs) } } -void Window::SetTitle(const char *s) -{ - if (wid) - window(wid)->setWindowTitle(s); -} - /* Returns rectangle of monitor pt is on, both rect and pt are in Window's window coordinates */ PRectangle Window::GetMonitorRect(Point pt) @@ -1201,47 +1185,6 @@ unsigned int Platform::DoubleClickTime() return QApplication::doubleClickInterval(); } -bool Platform::MouseButtonBounce() -{ - return false; -} - -bool Platform::IsKeyDown(int /*key*/) -{ - return false; -} - -long Platform::SendScintilla(WindowID /*w*/, - unsigned int /*msg*/, - unsigned long /*wParam*/, - long /*lParam*/) -{ - return 0; -} - -long Platform::SendScintillaPointer(WindowID /*w*/, - unsigned int /*msg*/, - unsigned long /*wParam*/, - void * /*lParam*/) -{ - return 0; -} - -int Platform::Minimum(int a, int b) -{ - return qMin(a, b); -} - -int Platform::Maximum(int a, int b) -{ - return qMax(a, b); -} - -int Platform::Clamp(int val, int minVal, int maxVal) -{ - return qBound(minVal, val, maxVal); -} - void Platform::DebugDisplay(const char *s) { qWarning("Scintilla: %s", s); @@ -1276,51 +1219,6 @@ void Platform::Assert(const char *c, const char *file, int line) } } - -bool Platform::IsDBCSLeadByte(int codePage, char ch) -{ - // Byte ranges found in Wikipedia articles with relevant search strings in each case - unsigned char uch = static_cast<unsigned char>(ch); - switch (codePage) { - case 932: - // Shift_jis - return ((uch >= 0x81) && (uch <= 0x9F)) || - ((uch >= 0xE0) && (uch <= 0xEF)); - case 936: - // GBK - return (uch >= 0x81) && (uch <= 0xFE); - case 949: - // Korean Wansung KS C-5601-1987 - return (uch >= 0x81) && (uch <= 0xFE); - case 950: - // Big5 - return (uch >= 0x81) && (uch <= 0xFE); - case 1361: - // Korean Johab KS C-5601-1992 - return - ((uch >= 0x84) && (uch <= 0xD3)) || - ((uch >= 0xD8) && (uch <= 0xDE)) || - ((uch >= 0xE0) && (uch <= 0xF9)); - } - return false; -} - -int Platform::DBCSCharLength(int codePage, const char *s) -{ - if (codePage == 932 || codePage == 936 || codePage == 949 || - codePage == 950 || codePage == 1361) { - return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1; - } else { - return 1; - } -} - -int Platform::DBCSCharMaxLength() -{ - return 2; -} - - //---------------------------------------------------------------------- static QElapsedTimer timer; |