diff options
author | nyamatongwe <devnull@localhost> | 2013-03-15 20:37:27 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-03-15 20:37:27 +1100 |
commit | 23d76d437f1089cdd2cc7c01cf011ec21f7f7a63 (patch) | |
tree | e4c80679bc19cdfd82555967f0d4d9a801d1d2b0 | |
parent | 7dc05d8d1ff8b415918817bb5963267b63c520e7 (diff) | |
download | scintilla-mirror-23d76d437f1089cdd2cc7c01cf011ec21f7f7a63.tar.gz |
Added type safety by using InnerView where applicable instead of generic NSView.
-rw-r--r-- | cocoa/ScintillaCocoa.h | 7 | ||||
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h index 27ce11fd8..302e39d97 100644 --- a/cocoa/ScintillaCocoa.h +++ b/cocoa/ScintillaCocoa.h @@ -54,6 +54,7 @@ extern "C" NSString* ScintillaRecPboardType; +@class InnerView; @class ScintillaView; @class FindHighlightLayer; @@ -132,16 +133,16 @@ protected: virtual CaseFolder *CaseFolderForEncoding(); virtual std::string CaseMapString(const std::string &s, int caseMapping); virtual void CancelModes(); -public: - NSView* ContentView(); - ScintillaCocoa(NSView* view); +public: + ScintillaCocoa(InnerView* view); virtual ~ScintillaCocoa(); void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback); sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); ScintillaView* TopContainer(); + InnerView* ContentView(); bool SyncPaint(void* gc, PRectangle rc); bool Draw(NSRect rect, CGContextRef gc); diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index a80361ce4..56de63d9c 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -379,7 +379,7 @@ const CGFloat paddingHighlightY = 2; //----------------- ScintillaCocoa ----------------------------------------------------------------- -ScintillaCocoa::ScintillaCocoa(NSView* view) +ScintillaCocoa::ScintillaCocoa(InnerView* view) { wMain = view; // Don't retain since we're owned by view, which would cause a cycle timerTarget = [[TimerTarget alloc] init: this]; @@ -686,9 +686,9 @@ ScintillaView* ScintillaCocoa::TopContainer() /** * Helper function to get the inner container which represents the actual "canvas" we work with. */ -NSView* ScintillaCocoa::ContentView() +InnerView* ScintillaCocoa::ContentView() { - return static_cast<NSView*>(wMain.GetID()); + return static_cast<InnerView*>(wMain.GetID()); } //-------------------------------------------------------------------------------------------------- |