From 46f9fd7509eaa2809392acf3a264b57a2daf973c Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 12 Jun 2017 11:49:56 +1000 Subject: 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. --- qt/ScintillaEditBase/PlatQt.cpp | 106 +--------------------------------------- 1 file changed, 2 insertions(+), 104 deletions(-) (limited to 'qt/ScintillaEditBase/PlatQt.cpp') 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 @@ -489,7 +490,7 @@ void SurfaceImpl::MeasureWidths(Font &font, // DBCS int ui = 0; for (int i=0; ihasFocus() : 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(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; -- cgit v1.2.3