diff options
| author | nyamatongwe <nyamatongwe@gmail.com> | 2013-09-08 12:57:45 +1000 | 
|---|---|---|
| committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-09-08 12:57:45 +1000 | 
| commit | 7165e22b51b8660fe81a0f4d4b99f31184154e73 (patch) | |
| tree | c2ec3056fe6d109762fb6357bed82c900015ae41 /cocoa | |
| parent | 0ee832d0249858a735112184e7d62be158d27228 (diff) | |
| download | scintilla-mirror-7165e22b51b8660fe81a0f4d4b99f31184154e73.tar.gz | |
Stop exposing Scintilla implementation to clients from ScintillaView header.
Platform.h and ScintillaCocoa.h are no longer imported in ScintillaView.h
Diffstat (limited to 'cocoa')
| -rw-r--r-- | cocoa/PlatCocoa.mm | 2 | ||||
| -rw-r--r-- | cocoa/ScintillaCocoa.h | 20 | ||||
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 2 | ||||
| -rw-r--r-- | cocoa/ScintillaView.h | 28 | ||||
| -rw-r--r-- | cocoa/ScintillaView.mm | 9 | 
5 files changed, 35 insertions, 26 deletions
| diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 3ce5abe0e..c5fba7533 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -12,7 +12,9 @@   * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).   */ +#import "Platform.h"  #import "ScintillaView.h" +#import "ScintillaCocoa.h"  #import "PlatCocoa.h"  #include <cstring> diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h index b7290506b..4842e2098 100644 --- a/cocoa/ScintillaCocoa.h +++ b/cocoa/ScintillaCocoa.h @@ -78,26 +78,6 @@ extern "C" NSString* ScintillaRecPboardType;  namespace Scintilla {  /** - * On the Mac, there is no WM_COMMAND or WM_NOTIFY message that can be sent - * back to the parent. Therefore, there must be a callback handler that acts - * like a Windows WndProc, where Scintilla can send notifications to. Use - * ScintillaCocoa::RegisterNotifyHandler() to register such a handler. - * Message format is: - * <br> - * WM_COMMAND: HIWORD (wParam) = notification code, LOWORD (wParam) = 0 (no control ID), lParam = ScintillaCocoa* - * <br> - * WM_NOTIFY: wParam = 0 (no control ID), lParam = ptr to SCNotification structure, with hwndFrom set to ScintillaCocoa* - */ -typedef void(*SciNotifyFunc) (intptr_t windowid, unsigned int iMessage, uintptr_t wParam, uintptr_t lParam); - -/** - * Scintilla sends these two messages to the notify handler. Please refer - * to the Windows API doc for details about the message format. - */ -#define	WM_COMMAND	1001 -#define WM_NOTIFY	1002 - -/**   * Main scintilla class, implemented for OS X (Cocoa).   */  class ScintillaCocoa : public ScintillaBase diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 38dc792a7..57367fcac 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -21,7 +21,9 @@  #import <QuartzCore/CAAnimation.h>  #import <QuartzCore/CATransaction.h> +#import "Platform.h"  #import "ScintillaView.h" +#import "ScintillaCocoa.h"  #import "PlatCocoa.h"  using namespace Scintilla; diff --git a/cocoa/ScintillaView.h b/cocoa/ScintillaView.h index 78fe65666..1b0c110fb 100644 --- a/cocoa/ScintillaView.h +++ b/cocoa/ScintillaView.h @@ -11,12 +11,34 @@  #import <Cocoa/Cocoa.h> -#import "Platform.h"  #import "Scintilla.h"  #import "SciLexer.h"  #import "InfoBarCommunicator.h" -#import "ScintillaCocoa.h" + +/** + * Scintilla sends these two messages to the notify handler. Please refer + * to the Windows API doc for details about the message format. + */ +#define WM_COMMAND 1001 +#define WM_NOTIFY 1002 + +namespace Scintilla { +/** + * On the Mac, there is no WM_COMMAND or WM_NOTIFY message that can be sent + * back to the parent. Therefore, there must be a callback handler that acts + * like a Windows WndProc, where Scintilla can send notifications to. Use + * ScintillaView registerNotifyCallback() to register such a handler. + * Message format is: + * <br> + * WM_COMMAND: HIWORD (wParam) = notification code, LOWORD (wParam) = control ID, lParam = ScintillaCocoa* + * <br> + * WM_NOTIFY: wParam = 0 (no control ID), lParam = ptr to SCNotification structure, with hwndFrom set to ScintillaCocoa* + */ +typedef void(*SciNotifyFunc) (intptr_t windowid, unsigned int iMessage, uintptr_t wParam, uintptr_t lParam); + +class ScintillaCocoa; +}  @class ScintillaView; @@ -64,7 +86,7 @@ extern NSString *SCIUpdateUINotification;  - (void) dealloc;  - (void) removeMarkedText; -- (void) setCursor: (Scintilla::Window::Cursor) cursor; +- (void) setCursor: (int) cursor;  - (BOOL) canUndo;  - (BOOL) canRedo; diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 8abc37308..8d51dc825 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -9,7 +9,9 @@   * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).   */ +#import "Platform.h"  #import "ScintillaView.h" +#import "ScintillaCocoa.h"  using namespace Scintilla; @@ -195,12 +197,13 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)  /**   * Called by the backend if a new cursor must be set for the view.   */ -- (void) setCursor: (Window::Cursor) cursor +- (void) setCursor: (int) cursor  { +  Window::Cursor eCursor = (Window::Cursor)cursor;    [mCurrentCursor autorelease]; -  mCurrentCursor = cursorFromEnum(cursor); +  mCurrentCursor = cursorFromEnum(eCursor);    [mCurrentCursor retain]; -   +    // Trigger recreation of the cursor rectangle(s).    [[self window] invalidateCursorRectsForView: self];  } | 
