From 9948c490832acd4d211070adfef982d1c0e8b4c4 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 14 May 2018 13:42:24 +1000 Subject: Modernize Platform.h (1) - noexcept, const, standard methods. Changes made to FontParameters, Font, Window, ListBoxEvent, ListBox, Menu, DynamicLibrary, and Platform. --- cocoa/PlatCocoa.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cocoa') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 9e0cf81f7..bdf0d3997 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -73,7 +73,7 @@ inline CGRect PRectangleToCGRect(PRectangle &rc) { //----------------- Font --------------------------------------------------------------------------- -Font::Font(): fid(0) { +Font::Font() noexcept : fid(0) { } //-------------------------------------------------------------------------------------------------- @@ -1018,7 +1018,7 @@ static CGFloat ScreenMax() { //-------------------------------------------------------------------------------------------------- -PRectangle Window::GetPosition() { +PRectangle Window::GetPosition() const { if (wid) { NSRect rect; id idWin = (__bridge id)(wid); @@ -1070,8 +1070,8 @@ void Window::SetPosition(PRectangle rc) { //-------------------------------------------------------------------------------------------------- -void Window::SetPositionRelative(PRectangle rc, Window window) { - PRectangle rcOther = window.GetPosition(); +void Window::SetPositionRelative(PRectangle rc, const Window *window) { + PRectangle rcOther = window->GetPosition(); rc.left += rcOther.left; rc.right += rcOther.left; rc.top += rcOther.top; @@ -1081,7 +1081,7 @@ void Window::SetPositionRelative(PRectangle rc, Window window) { //-------------------------------------------------------------------------------------------------- -PRectangle Window::GetClientPosition() { +PRectangle Window::GetClientPosition() const { // This means, in MacOS X terms, get the "frame bounds". Call GetPosition, just like on Win32. return GetPosition(); } @@ -1693,7 +1693,7 @@ void ListBoxImpl::SelectionChange() { // ListBox is implemented by the ListBoxImpl class. -ListBox::ListBox() { +ListBox::ListBox() noexcept { } ListBox::~ListBox() { @@ -1743,7 +1743,7 @@ NSMenu //----------------- Menu --------------------------------------------------------------------------- -Menu::Menu() +Menu::Menu() noexcept : mid(0) { } -- cgit v1.2.3