diff options
Diffstat (limited to 'cocoa')
| -rw-r--r-- | cocoa/PlatCocoa.h | 1 | ||||
| -rw-r--r-- | cocoa/PlatCocoa.mm | 132 | ||||
| -rw-r--r-- | cocoa/ScintillaCocoa.h | 1 | ||||
| -rw-r--r-- | cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj | 4 | 
4 files changed, 6 insertions, 132 deletions
| diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 1394a7b16..386e339b5 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -105,7 +105,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 3dfaa13e2..5c61b9c7b 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -83,18 +83,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) { @@ -921,7 +909,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); @@ -984,15 +972,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_); @@ -1043,13 +1022,6 @@ Window::~Window() {  //-------------------------------------------------------------------------------------------------- -bool Window::HasFocus() { -	NSView *container = (__bridge NSView *)(wid); -	return container.window.firstResponder == container; -} - -//-------------------------------------------------------------------------------------------------- -  static CGFloat ScreenMax() {  	return NSMaxY([NSScreen mainScreen].frame);  } @@ -1205,19 +1177,6 @@ void Window::SetCursor(Cursor curs) {  //-------------------------------------------------------------------------------------------------- -void Window::SetTitle(const char *s) { -	if (wid) { -		id idWin = (__bridge id)(wid); -		if ([idWin isKindOfClass: [NSWindow class]]) { -			NSWindow *win = idWin; -			NSString *sTitle = @(s); -			win.title = sTitle; -		} -	} -} - -//-------------------------------------------------------------------------------------------------- -  PRectangle Window::GetMonitorRect(Point) {  	if (wid) {  		id idWin = (__bridge id)(wid); @@ -1897,85 +1856,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 @@ -2026,16 +1906,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 25fc133ca..9149a6ede 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 e491ef619..671799fc1 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 */; }; @@ -423,6 +424,7 @@  		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>"; };  		282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexIndent.cxx; path = ../../lexers/LexIndent.cxx; sourceTree = SOURCE_ROOT; }; +		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>"; }; @@ -724,6 +726,7 @@  				114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */,  				114B6F6411FA7597004FB6AB /* CharClassify.cxx */,  				114B6F6511FA7597004FB6AB /* ContractionState.cxx */, +				28804B2B1EEE232E00C0D154 /* DBCS.cxx */,  				114B6F6611FA7597004FB6AB /* Decoration.cxx */,  				114B6F6711FA7597004FB6AB /* Document.cxx */,  				28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */, @@ -1010,6 +1013,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 */, | 
