From 7165e22b51b8660fe81a0f4d4b99f31184154e73 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 8 Sep 2013 12:57:45 +1000 Subject: Stop exposing Scintilla implementation to clients from ScintillaView header. Platform.h and ScintillaCocoa.h are no longer imported in ScintillaView.h --- cocoa/ScintillaView.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'cocoa/ScintillaView.h') 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 -#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: + *
+ * WM_COMMAND: HIWORD (wParam) = notification code, LOWORD (wParam) = control ID, lParam = ScintillaCocoa* + *
+ * 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; -- cgit v1.2.3