aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-07-08 13:08:02 +1000
committerNeil <nyamatongwe@gmail.com>2014-07-08 13:08:02 +1000
commit7a875962c50e21c6403bdeecc549faca72a3bea1 (patch)
treeb401353891efd11380cbf35c2bcd178bc08aacdc /cocoa
parentf2749ccb2d9dbf953733900f02aa0baa6e695cd7 (diff)
downloadscintilla-mirror-7a875962c50e21c6403bdeecc549faca72a3bea1.tar.gz
Specifying some methods as const as they are used from display and measurement
code that will be changed to have read-only access.
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/ScintillaCocoa.h6
-rw-r--r--cocoa/ScintillaCocoa.mm6
2 files changed, 6 insertions, 6 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index 05ee56c7c..ec253b161 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -111,8 +111,8 @@ private:
FindHighlightLayer *layerFindIndicator;
protected:
- Point GetVisibleOriginInMain();
- PRectangle GetClientRectangle();
+ Point GetVisibleOriginInMain() const;
+ PRectangle GetClientRectangle() const;
virtual PRectangle GetClientDrawingRectangle();
Point ConvertPoint(NSPoint point);
virtual void RedrawRect(PRectangle rc);
@@ -133,7 +133,7 @@ public:
void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback);
sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
- NSScrollView* ScrollContainer();
+ NSScrollView* ScrollContainer() const;
SCIContentView* ContentView();
bool SyncPaint(void* gc, PRectangle rc);
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index b4c16dce4..10992ba86 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -658,7 +658,7 @@ void ScintillaCocoa::CancelModes() {
/**
* Helper function to get the scrolling view.
*/
-NSScrollView* ScintillaCocoa::ScrollContainer() {
+NSScrollView* ScintillaCocoa::ScrollContainer() const {
NSView* container = static_cast<NSView*>(wMain.GetID());
return static_cast<NSScrollView*>([[container superview] superview]);
}
@@ -678,7 +678,7 @@ SCIContentView* ScintillaCocoa::ContentView()
/**
* Return the top left visible point relative to the origin point of the whole document.
*/
-Scintilla::Point ScintillaCocoa::GetVisibleOriginInMain()
+Scintilla::Point ScintillaCocoa::GetVisibleOriginInMain() const
{
NSScrollView *scrollView = ScrollContainer();
NSRect contentRect = [[scrollView contentView] bounds];
@@ -692,7 +692,7 @@ Scintilla::Point ScintillaCocoa::GetVisibleOriginInMain()
* in order to make scrolling working properly.
* The returned value is in document coordinates.
*/
-PRectangle ScintillaCocoa::GetClientRectangle()
+PRectangle ScintillaCocoa::GetClientRectangle() const
{
NSScrollView *scrollView = ScrollContainer();
NSSize size = [[scrollView contentView] bounds].size;