aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-02 23:13:54 +0200
committerDavid Robillard <d@drobilla.net>2020-07-02 23:13:54 +0200
commit5182a0348e99e8793f0e0230254eb7ddbc8a3dfd (patch)
tree6d505c2b8739cfc7291b1b612b80fe0ea9daa08b
parent9483e34037463b083d3e7f437eec6f72c8173996 (diff)
downloadpugl-5182a0348e99e8793f0e0230254eb7ddbc8a3dfd.tar.gz
pugl-5182a0348e99e8793f0e0230254eb7ddbc8a3dfd.tar.bz2
pugl-5182a0348e99e8793f0e0230254eb7ddbc8a3dfd.zip
Mac: Declare instance variables in implementation
Declaring instance variables in interfaces is deprecated, according to Wobjc-interface-vars (Apple clang version 11.0.0).
-rw-r--r--pugl/detail/mac.h13
-rw-r--r--pugl/detail/mac.m19
-rw-r--r--pugl/detail/mac_cairo.m7
-rw-r--r--pugl/detail/mac_gl.m7
-rw-r--r--pugl/detail/mac_stub.m7
5 files changed, 25 insertions, 28 deletions
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 <stdint.h>
@interface PuglWrapperView : NSView<NSTextInputClient>
-{
-@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<NSWindowDelegate>
-{
- 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 <assert.h>
@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 <Cocoa/Cocoa.h>
@interface PuglStubView : NSView
+@end
+
+@implementation PuglStubView
{
@public
PuglView* puglview;
}
-@end
-
-@implementation PuglStubView
-
- (void) resizeWithOldSuperviewSize:(NSSize)oldSize
{
PuglWrapperView* wrapper = (PuglWrapperView*)[self superview];