Skip to content

Commit 2952799

Browse files
committed
remove class reference variables from public apis
1 parent 768030f commit 2952799

11 files changed

+28
-28
lines changed

cocoa/NSApplication.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ type NSApplication struct {
2828
objc.Object
2929
}
3030

31-
var NSApplication_ = objc.Get("NSApplication")
31+
var nsApplication = objc.Get("NSApplication")
3232

3333
func NSApplication_New() NSApplication {
34-
return NSApplication{NSApplication_.Alloc().Init()}
34+
return NSApplication{nsApplication.Alloc().Init()}
3535
}
3636

3737
func NSApp() NSApplication {
38-
return NSApplication{NSApplication_.Send("sharedApplication")}
38+
return NSApplication{nsApplication.Send("sharedApplication")}
3939
}
4040

4141
func NSApp_WithDidLaunch(cb func(notification objc.Object)) NSApplication {

cocoa/NSMenu.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ type NSMenu struct {
99
objc.Object
1010
}
1111

12-
var NSMenu_ = objc.Get("NSMenu")
12+
var nsMenu = objc.Get("NSMenu")
1313

1414
func NSMenu_New() NSMenu {
15-
return NSMenu{NSMenu_.Alloc().Init()}
15+
return NSMenu{nsMenu.Alloc().Init()}
1616
}
1717

1818
func NSMenu_Init(title string) NSMenu {
19-
return NSMenu{NSMenu_.Alloc().Send("initWithTitle:", core.String(title))}
19+
return NSMenu{nsMenu.Alloc().Send("initWithTitle:", core.String(title))}
2020
}
2121

2222
func (menu NSMenu) SetTitle(title string) {

cocoa/NSWindow.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ type NSWindow struct {
4747
objc.Object
4848
}
4949

50-
var NSWindow_ = objc.Get("NSWindow")
50+
var nsWindow = objc.Get("NSWindow")
5151

5252
func NSWindow_New() NSWindow {
53-
return NSWindow{NSWindow_.Alloc().Init()}
53+
return NSWindow{nsWindow.Alloc().Init()}
5454
}
5555

5656
func NSWindow_WithContentViewController(controller objc.Object) NSWindow {
57-
return NSWindow{NSWindow_.Send("windowWithContentViewController:", controller)}
57+
return NSWindow{nsWindow.Send("windowWithContentViewController:", controller)}
5858
}
5959

6060
func NSWindow_Init(rect core.NSRect, windowStyle core.NSUInteger, bufferingType NSBackingStoreType, deferCreation bool) NSWindow {
61-
obj := NSWindow_.Alloc().
61+
obj := nsWindow.Alloc().
6262
Send("initWithContentRect:styleMask:backing:defer:",
6363
rect, windowStyle, bufferingType, deferCreation)
6464
return NSWindow{obj}

core/NSAutoreleasePool.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ type NSAutoreleasePool struct {
66
objc.Object
77
}
88

9-
var NSAutoreleasePool_ = objc.Get("NSAutoreleasePool")
9+
var nsAutoreleasePool = objc.Get("NSAutoreleasePool")
1010

1111
func NSAutoreleasePool_New() NSAutoreleasePool {
12-
return NSAutoreleasePool{NSAutoreleasePool_.Alloc().Init()}
12+
return NSAutoreleasePool{nsAutoreleasePool.Alloc().Init()}
1313
}

core/NSDictionary.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ type NSDictionary struct {
88
objc.Object
99
}
1010

11-
var NSDictionary_ = objc.Get("NSDictionary")
11+
var nsDictionary = objc.Get("NSDictionary")
1212

1313
func NSDictionary_New() NSDictionary {
14-
return NSDictionary{NSDictionary_.Alloc().Init()}
14+
return NSDictionary{nsDictionary.Alloc().Init()}
1515
}
1616

1717
func NSDictionary_Init(valueKeys ...interface{}) NSDictionary {
18-
return NSDictionary{NSDictionary_.Alloc().Send("initWithObjectsAndKeys:", valueKeys...)}
18+
return NSDictionary{nsDictionary.Alloc().Send("initWithObjectsAndKeys:", valueKeys...)}
1919
}
2020

2121
func (d NSDictionary) ObjectForKey(key objc.Object) objc.Object {

core/NSRunLoop.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ type NSRunLoop struct {
66
objc.Object
77
}
88

9-
var NSRunLoop_ = objc.Get("NSRunLoop")
9+
var nsRunLoop = objc.Get("NSRunLoop")
1010

1111
func NSRunLoop_Current() NSRunLoop {
12-
return NSRunLoop{NSRunLoop_.Send("currentRunLoop")}
12+
return NSRunLoop{nsRunLoop.Send("currentRunLoop")}
1313
}
1414

1515
func NSRunLoop_Main() NSRunLoop {
16-
return NSRunLoop{NSRunLoop_.Send("mainRunLoop")}
16+
return NSRunLoop{nsRunLoop.Send("mainRunLoop")}
1717
}
1818

1919
func (rl NSRunLoop) Run() {

core/NSString.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ type NSString struct {
1515
objc.Object
1616
}
1717

18-
var NSString_ = objc.Get("NSString")
18+
var nsString = objc.Get("NSString")
1919

2020
func NSString_FromString(str string) NSString {
2121
hdrp := (*reflect.StringHeader)(unsafe.Pointer(&str))
22-
obj := NSString_.Alloc().Send("initWithBytes:length:encoding:", hdrp.Data, hdrp.Len, NSUTF8StringEncoding)
22+
obj := nsString.Alloc().Send("initWithBytes:length:encoding:", hdrp.Data, hdrp.Len, NSUTF8StringEncoding)
2323
return NSString_FromObject(obj)
2424
}
2525

core/NSThread.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ type NSThread struct {
66
objc.Object
77
}
88

9-
var NSThread_ = objc.Get("NSThread")
9+
var nsThread = objc.Get("NSThread")
1010

1111
func NSThread_IsMainThread() bool {
12-
return NSThread_.Send("isMainThread") != nil
12+
return nsThread.Send("isMainThread") != nil
1313
}

core/NSURL.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ type NSURL struct {
88
objc.Object
99
}
1010

11-
var NSURL_ = objc.Get("NSURL")
11+
var nsURL = objc.Get("NSURL")
1212

1313
func NSURL_Init(url string) NSURL {
14-
return NSURL{NSURL_.Send("URLWithString:", NSString_FromString(url))}
14+
return NSURL{nsURL.Send("URLWithString:", NSString_FromString(url))}
1515
}

core/NSURLRequest.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ type NSURLRequest struct {
66
objc.Object
77
}
88

9-
var NSURLRequest_ = objc.Get("NSURLRequest")
9+
var nsURLRequest = objc.Get("NSURLRequest")
1010

1111
func NSURLRequest_Init(url NSURL) NSURLRequest {
12-
return NSURLRequest{NSURLRequest_.Send("requestWithURL:", url)}
12+
return NSURLRequest{nsURLRequest.Send("requestWithURL:", url)}
1313
}

webkit/WKWebView.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ type WKWebView struct {
1010
cocoa.NSView
1111
}
1212

13-
var WKWebView_ = objc.Get("WKWebView")
13+
var wkWebView = objc.Get("WKWebView")
1414

1515
func WKWebView_Init(frame core.NSRect, config WKWebViewConfiguration) WKWebView {
16-
return WKWebView{cocoa.NSView{WKWebView_.Alloc().Send("initWithFrame:configuration:", frame, config)}}
16+
return WKWebView{cocoa.NSView{wkWebView.Alloc().Send("initWithFrame:configuration:", frame, config)}}
1717
}
1818

1919
func (wv WKWebView) LoadRequest(req core.NSURLRequest) {

0 commit comments

Comments
 (0)