summaryrefslogtreecommitdiff
path: root/objc_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-05-15 20:14:44 -0400
committerPietro Gagliardi <[email protected]>2014-05-15 20:14:44 -0400
commitb7db0e15cda8ebd63831b19b59ebebb5236d3bcf (patch)
tree15703d21a32cd727641599fa0a9638755d5506bd /objc_darwin.go
parent9d8976ababebfd7ce670cdb05e3bc303ac466bf6 (diff)
Removed all the objc_getClass() and sel_getUid() calls from the Go code on Mac OS X. Also got rid of a forgotten objc_msgSend(). Now comes the Objective-C half...
Diffstat (limited to 'objc_darwin.go')
-rw-r--r--objc_darwin.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/objc_darwin.go b/objc_darwin.go
index 0b8fd9d..a94e13a 100644
--- a/objc_darwin.go
+++ b/objc_darwin.go
@@ -9,36 +9,8 @@ import (
// #cgo LDFLAGS: -lobjc -framework Foundation
// #include <stdlib.h>
// #include "objc_darwin.h"
-// /* cgo doesn't like Nil */
-// Class NilClass = Nil;
import "C"
-func objc_getClass(class string) C.id {
- cclass := C.CString(class)
- defer C.free(unsafe.Pointer(cclass))
-
- return C.objc_getClass(cclass)
-}
-
-func sel_getUid(sel string) C.SEL {
- csel := C.CString(sel)
- defer C.free(unsafe.Pointer(csel))
-
- return C.sel_getUid(csel)
-}
-
-// Common Objective-C types and selectors.
-var (
- _NSObject = objc_getClass("NSObject")
- _NSString = objc_getClass("NSString")
-
- _alloc = sel_getUid("alloc")
- _new = sel_getUid("new")
- _release = sel_getUid("release")
- _stringWithUTF8String = sel_getUid("stringWithUTF8String:")
- _UTF8String = sel_getUid("UTF8String")
-)
-
func toNSString(str string) C.id {
cstr := C.CString(str)
defer C.free(unsafe.Pointer(cstr))
@@ -52,16 +24,6 @@ func fromNSString(str C.id) string {
// These consolidate the NSScrollView code (used by listbox_darwin.go and area_darwin.go) into a single place.
-var (
- _NSScrollView = objc_getClass("NSScrollView")
-
- _setHasHorizontalScroller = sel_getUid("setHasHorizontalScroller:")
- _setHasVerticalScroller = sel_getUid("setHasVerticalScroller:")
- _setAutohidesScrollers = sel_getUid("setAutohidesScrollers:")
- _setDocumentView = sel_getUid("setDocumentView:")
- _documentView = sel_getUid("documentView")
-)
-
func newScrollView(content C.id) C.id {
return C.makeScrollView(content)
}