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 /gtk/PlatGTK.cxx | |
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 'gtk/PlatGTK.cxx')
-rw-r--r-- | gtk/PlatGTK.cxx | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 5252e890c..06926f347 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -107,12 +107,6 @@ static GtkWidget *PWidget(WindowID wid) { return static_cast<GtkWidget *>(wid); } -Point Point::FromLong(long lpoint) { - return Point( - Platform::LowShortFromLong(lpoint), - Platform::HighShortFromLong(lpoint)); -} - Font::Font() : fid(0) {} Font::~Font() {} @@ -184,7 +178,6 @@ public: XYPOSITION Ascent(Font &font_) override; XYPOSITION Descent(Font &font_) override; XYPOSITION InternalLeading(Font &font_) override; - XYPOSITION ExternalLeading(Font &font_) override; XYPOSITION Height(Font &font_) override; XYPOSITION AverageCharWidth(Font &font_) override; @@ -925,10 +918,6 @@ XYPOSITION SurfaceImpl::InternalLeading(Font &) { return 0; } -XYPOSITION SurfaceImpl::ExternalLeading(Font &) { - return 0; -} - XYPOSITION SurfaceImpl::Height(Font &font_) { return Ascent(font_) + Descent(font_); } @@ -978,10 +967,6 @@ void Window::Destroy() { } } -bool Window::HasFocus() { - return gtk_widget_has_focus(GTK_WIDGET(wid)); -} - PRectangle Window::GetPosition() { // Before any size allocated pretend its 1000 wide so not scrolled PRectangle rc(0, 0, 1000, 1000); @@ -1125,10 +1110,6 @@ void Window::SetCursor(Cursor curs) { #endif } -void Window::SetTitle(const char *s) { - gtk_window_set_title(GTK_WINDOW(wid), s); -} - /* Returns rectangle of monitor pt is on, both rect and pt are in Window's gdk window coordinates */ PRectangle Window::GetMonitorRect(Point pt) { @@ -2025,83 +2006,10 @@ unsigned int Platform::DoubleClickTime() { return 500; // Half a second } -bool Platform::MouseButtonBounce() { - return true; -} - void Platform::DebugDisplay(const char *s) { fprintf(stderr, "%s", s); } -bool Platform::IsKeyDown(int) { - // TODO: discover state of keys in GTK+/X - return false; -} - -long Platform::SendScintilla( - WindowID w, unsigned int msg, unsigned long wParam, long lParam) { - return scintilla_send_message(SCINTILLA(w), msg, wParam, lParam); -} - -long Platform::SendScintillaPointer( - WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { - return scintilla_send_message(SCINTILLA(w), msg, wParam, - reinterpret_cast<sptr_t>(lParam)); -} - -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 <= 0xFC)); - // Lead bytes F0 to FC may be a Microsoft addition. - case 936: - // GBK - return (uch >= 0x81) && (uch <= 0xFE); - case 950: - // Big5 - return (uch >= 0x81) && (uch <= 0xFE); - // Korean EUC-KR may be code page 949. - } - return false; -} - -int Platform::DBCSCharLength(int codePage, const char *s) { - if (codePage == 932 || codePage == 936 || codePage == 950) { - return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1; - } else { - int bytes = mblen(s, MB_CUR_MAX); - if (bytes >= 1) - return bytes; - else - return 1; - } -} - -int Platform::DBCSCharMaxLength() { - return MB_CUR_MAX; - //return 2; -} - -// These are utility functions not really tied to a platform - -int Platform::Minimum(int a, int b) { - if (a < b) - return a; - else - return b; -} - -int Platform::Maximum(int a, int b) { - if (a > b) - return a; - else - return b; -} - //#define TRACE #ifdef TRACE @@ -2134,14 +2042,6 @@ void Platform::Assert(const char *c, const char *file, int line) { abort(); } -int Platform::Clamp(int val, int minVal, int maxVal) { - if (val > maxVal) - val = maxVal; - if (val < minVal) - val = minVal; - return val; -} - void Platform_Initialise() { } |