aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/PlatCocoa.h1
-rw-r--r--cocoa/PlatCocoa.mm146
-rw-r--r--cocoa/ScintillaCocoa.h1
-rw-r--r--cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj4
4 files changed, 6 insertions, 146 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h
index f8f1bd698..05d2598f4 100644
--- a/cocoa/PlatCocoa.h
+++ b/cocoa/PlatCocoa.h
@@ -107,7 +107,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;
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 0e311126e..0069106e5 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -87,19 +87,6 @@ inline PRectangle CGRectToPRectangle(const CGRect& rect)
return rc;
}
-//----------------- Point --------------------------------------------------------------------------
-
-/**
- * Converts a point given as a long into a native Point structure.
- */
-Scintilla::Point Scintilla::Point::FromLong(long lpoint)
-{
- return Scintilla::Point(
- Platform::LowShortFromLong(lpoint),
- Platform::HighShortFromLong(lpoint)
- );
-}
-
//----------------- Font ---------------------------------------------------------------------------
Font::Font(): fid(0)
@@ -982,7 +969,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION
} else if (codePage) {
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;
CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, ui+1, NULL);
for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
positions[i++] = static_cast<XYPOSITION>(xPosition);
@@ -1048,15 +1035,6 @@ XYPOSITION SurfaceImpl::InternalLeading(Font &) {
return 0;
}
-XYPOSITION SurfaceImpl::ExternalLeading(Font &font_) {
- if (!font_.GetID())
- return 1;
-
- float leading = static_cast<QuartzTextStyle*>( font_.GetID() )->getLeading();
- return leading + 0.5f;
-
-}
-
XYPOSITION SurfaceImpl::Height(Font &font_) {
return Ascent(font_) + Descent(font_);
@@ -1109,14 +1087,6 @@ Window::~Window()
//--------------------------------------------------------------------------------------------------
-bool Window::HasFocus()
-{
- NSView* container = static_cast<NSView*>(wid);
- return [[container window] firstResponder] == container;
-}
-
-//--------------------------------------------------------------------------------------------------
-
static CGFloat ScreenMax()
{
return NSMaxY([[NSScreen mainScreen] frame]);
@@ -1307,22 +1277,6 @@ void Window::SetCursor(Cursor curs)
//--------------------------------------------------------------------------------------------------
-void Window::SetTitle(const char* s)
-{
- if (wid)
- {
- id idWin = static_cast<id>(wid);
- if ([idWin isKindOfClass: [NSWindow class]])
- {
- NSWindow* win = idWin;
- NSString* sTitle = [NSString stringWithUTF8String:s];
- [win setTitle:sTitle];
- }
- }
-}
-
-//--------------------------------------------------------------------------------------------------
-
PRectangle Window::GetMonitorRect(Point)
{
if (wid)
@@ -2098,93 +2052,6 @@ unsigned int Platform::DoubleClickTime()
//--------------------------------------------------------------------------------------------------
-bool Platform::MouseButtonBounce()
-{
- return false;
-}
-
-//--------------------------------------------------------------------------------------------------
-
-/**
- * Helper method for the backend to reach through to the scintilla window.
- */
-long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam)
-{
- return scintilla_send_message(w, msg, wParam, lParam);
-}
-
-//--------------------------------------------------------------------------------------------------
-
-/**
- * Helper method for the backend to reach through to the scintilla window.
- */
-long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam)
-{
- return scintilla_send_message(w, msg, wParam, (long) 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 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 */)
-{
- // DBCS no longer uses this.
- return 1;
-}
-
-//--------------------------------------------------------------------------------------------------
-
-int Platform::DBCSCharMaxLength()
-{
- return 2;
-}
-
-//--------------------------------------------------------------------------------------------------
-
-int Platform::Minimum(int a, int b)
-{
- return (a < b) ? a : b;
-}
-
-//--------------------------------------------------------------------------------------------------
-
-int Platform::Maximum(int a, int b) {
- return (a > b) ? a : b;
-}
-
-//--------------------------------------------------------------------------------------------------
-
//#define TRACE
#ifdef TRACE
@@ -2239,17 +2106,6 @@ void Platform::Assert(const char *c, const char *file, int line)
#endif
}
-//--------------------------------------------------------------------------------------------------
-
-int Platform::Clamp(int val, int minVal, int maxVal)
-{
- if (val > maxVal)
- val = maxVal;
- if (val < minVal)
- val = minVal;
- return val;
-}
-
//----------------- DynamicLibrary -----------------------------------------------------------------
/**
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index 7b9231012..21eb83b79 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -52,6 +52,7 @@
#include "Document.h"
#include "CaseConvert.h"
#include "UniConversion.h"
+#include "DBCS.h"
#include "Selection.h"
#include "PositionCache.h"
#include "EditModel.h"
diff --git a/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj b/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
index 0a8ea2723..46dd898ba 100644
--- a/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
+++ b/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
@@ -199,6 +199,7 @@
280056FC188DDD2C00F200AE /* StringCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F9188DDD2C00F200AE /* StringCopy.h */; };
280056FD188DDD2C00F200AE /* SubStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056FA188DDD2C00F200AE /* SubStyles.h */; };
28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28064A04190F12E100E6E47F /* LexDMIS.cxx */; };
+ 28804B2C1EEE232E00C0D154 /* DBCS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28804B2B1EEE232E00C0D154 /* DBCS.cxx */; };
28A067111A36B42600B4966A /* LexHex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A067101A36B42600B4966A /* LexHex.cxx */; };
28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */; };
28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */; };
@@ -424,6 +425,7 @@
280056F9188DDD2C00F200AE /* StringCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringCopy.h; path = ../../lexlib/StringCopy.h; sourceTree = "<group>"; };
280056FA188DDD2C00F200AE /* SubStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SubStyles.h; path = ../../lexlib/SubStyles.h; sourceTree = "<group>"; };
28064A04190F12E100E6E47F /* LexDMIS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMIS.cxx; path = ../../lexers/LexDMIS.cxx; sourceTree = "<group>"; };
+ 28804B2B1EEE232E00C0D154 /* DBCS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DBCS.cxx; path = ../../src/DBCS.cxx; sourceTree = "<group>"; };
28A067101A36B42600B4966A /* LexHex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHex.cxx; path = ../../lexers/LexHex.cxx; sourceTree = "<group>"; };
28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditModel.cxx; path = ../../src/EditModel.cxx; sourceTree = "<group>"; };
28A1DD4F196BE0CA006EFCDD /* EditView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditView.cxx; path = ../../src/EditView.cxx; sourceTree = "<group>"; };
@@ -727,6 +729,7 @@
114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */,
114B6F6411FA7597004FB6AB /* CharClassify.cxx */,
114B6F6511FA7597004FB6AB /* ContractionState.cxx */,
+ 28804B2B1EEE232E00C0D154 /* DBCS.cxx */,
114B6F6611FA7597004FB6AB /* Decoration.cxx */,
114B6F6711FA7597004FB6AB /* Document.cxx */,
28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */,
@@ -1013,6 +1016,7 @@
114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */,
114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */,
114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */,
+ 28804B2C1EEE232E00C0D154 /* DBCS.cxx in Sources */,
114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */,
114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */,
28B6470D1B54C0720009DC49 /* LexDiff.cxx in Sources */,