From 5182a0348e99e8793f0e0230254eb7ddbc8a3dfd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 2 Jul 2020 23:13:54 +0200 Subject: Mac: Declare instance variables in implementation Declaring instance variables in interfaces is deprecated, according to Wobjc-interface-vars (Apple clang version 11.0.0). --- pugl/detail/mac.h | 13 ------------- pugl/detail/mac.m | 19 ++++++++++++++++--- pugl/detail/mac_cairo.m | 7 +++---- pugl/detail/mac_gl.m | 7 +++---- pugl/detail/mac_stub.m | 7 +++---- 5 files changed, 25 insertions(+), 28 deletions(-) (limited to 'pugl') diff --git a/pugl/detail/mac.h b/pugl/detail/mac.h index 296faeb..7b64cfe 100644 --- a/pugl/detail/mac.h +++ b/pugl/detail/mac.h @@ -27,15 +27,6 @@ #include @interface PuglWrapperView : NSView -{ -@public - PuglView* puglview; - NSTrackingArea* trackingArea; - NSMutableAttributedString* markedText; - NSTimer* timer; - NSMutableDictionary* userTimers; - bool reshaped; -} - (void) dispatchExpose:(NSRect)rect; - (void) setReshaped; @@ -43,10 +34,6 @@ @end @interface PuglWindow : NSWindow -{ -@public - PuglView* puglview; -} - (void) setPuglview:(PuglView*)view; diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index e46d989..0c25f04 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -119,6 +119,10 @@ updateViewRect(PuglView* view) } @implementation PuglWindow +{ +@public + PuglView* puglview; +} - (id) initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)aStyle @@ -180,6 +184,15 @@ updateViewRect(PuglView* view) @end @implementation PuglWrapperView +{ +@public + PuglView* puglview; + NSTrackingArea* trackingArea; + NSMutableAttributedString* markedText; + NSTimer* timer; + NSMutableDictionary* userTimers; + bool reshaped; +} - (void) dispatchExpose:(NSRect)rect { @@ -728,15 +741,15 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type) @end @interface PuglWindowDelegate : NSObject -{ - PuglWindow* window; -} - (instancetype) initWithPuglWindow:(PuglWindow*)window; @end @implementation PuglWindowDelegate +{ + PuglWindow* window; +} - (instancetype) initWithPuglWindow:(PuglWindow*)puglWindow { diff --git a/pugl/detail/mac_cairo.m b/pugl/detail/mac_cairo.m index 2014664..ddb82bd 100644 --- a/pugl/detail/mac_cairo.m +++ b/pugl/detail/mac_cairo.m @@ -31,6 +31,9 @@ #include @interface PuglCairoView : NSView +@end + +@implementation PuglCairoView { @public PuglView* puglview; @@ -38,10 +41,6 @@ cairo_t* cr; } -@end - -@implementation PuglCairoView - - (id) initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; diff --git a/pugl/detail/mac_gl.m b/pugl/detail/mac_gl.m index 8cfbd93..d1461ec 100644 --- a/pugl/detail/mac_gl.m +++ b/pugl/detail/mac_gl.m @@ -29,15 +29,14 @@ #endif @interface PuglOpenGLView : NSOpenGLView +@end + +@implementation PuglOpenGLView { @public PuglView* puglview; } -@end - -@implementation PuglOpenGLView - - (id) initWithFrame:(NSRect)frame { const bool compat = puglview->hints[PUGL_USE_COMPAT_PROFILE]; diff --git a/pugl/detail/mac_stub.m b/pugl/detail/mac_stub.m index f90d6a1..2c81357 100644 --- a/pugl/detail/mac_stub.m +++ b/pugl/detail/mac_stub.m @@ -26,15 +26,14 @@ #import @interface PuglStubView : NSView +@end + +@implementation PuglStubView { @public PuglView* puglview; } -@end - -@implementation PuglStubView - - (void) resizeWithOldSuperviewSize:(NSSize)oldSize { PuglWrapperView* wrapper = (PuglWrapperView*)[self superview]; -- cgit v1.2.1