Improve type handling for enums. Handle "__kindof" qualifiers.

Add examples/app. Allow VisibilityAttr "Hidden".
This commit is contained in:
gmp
2019-05-06 13:21:36 -04:00
parent 959b87342e
commit 511f2f1968
12 changed files with 105 additions and 24 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"gitlab.wow.st/gmp/nswrap/examples/app/ns"
)
func main() {
a := ns.NSApplicationSharedApplication()
a.SetActivationPolicy(ns.NSApplicationActivationPolicyRegular)
//w := ns.NSWindowAlloc()
w := ns.NSWindowAlloc().InitWithContentRect(
ns.NSMakeRect(200,200,600,600),
ns.NSWindowStyleMaskTitled,
ns.NSBackingStoreBuffered,
0,
nil,
)
w.SetTitle(ns.NSStringWithGoString("Hi World"))
w.MakeKeyAndOrderFront(w)
a.Run()
}
+39
View File
@@ -0,0 +1,39 @@
InputFiles = [
"/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h",
"/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h",
]
Classes = [
"NSArray",
"NSMutableArray",
"NSDictionary",
"NSEnumerator",
"NSSet",
"NSDate",
"NSTimeZone",
"NSCalendar",
"NSLocale",
"NSCharacterSet",
"NSString",
"NSScanner",
"NSFileManager",
"NSApplication",
"NSBundle",
"NSApp",
"NSWindow",
"NSScreen",
"NSEvent",
"NSResponder",
]
Functions = [
"NSApplicationMain",
"NSMake.*",
]
Enums = [
"CF.*",
"NSApplication.*",
"NSBackingStore.*",
"NSWindowStyleMask.*",
]
Frameworks = [ "Foundation", "AppKit", "CoreGraphics" ]
Pragma = [ 'clang diagnostic ignored "-Wformat-security"' ]
VaArgs = 32
+2 -1
View File
@@ -12,7 +12,8 @@ func main() {
c1 := n1.CapitalizedString()
gs := c1.UTF8String().String()
fmt.Println(gs)
n2 := ns.NSStringWithGoString("hi world")
n2 := ns.NSStringAlloc()
n2 = n2.InitWithGoString("hi world")
n3 := ns.NSStringWithGoString("ok bye")
a := ns.NSMutableArrayWithObjects(n1,n2,n3)
fmt.Println("Length(a) = ",a.Count())
+1
View File
@@ -20,6 +20,7 @@ Functions = [
"NSMakeRange",
]
Enums = [
"P_ALL",
"CF.*",
]
Frameworks = [ "Foundation" ]
+2 -2
View File
@@ -7,7 +7,7 @@ import (
)
func main() {
o := ns.NewClassOne().Init()
o := ns.ClassOneAlloc().Init()
fmt.Println("i1 = ",o.Geti1())
fmt.Println("p1 = ",o.Getp1())
p1 := o.Getp1()
@@ -18,7 +18,7 @@ func main() {
np := o.Nstru2()
fmt.Println(o.Hi1(ns1))
fmt.Println(o.Hi2(np))
o2 := ns.NewClassTwo().Init()
o2 := ns.ClassTwoAlloc().Init()
fmt.Println(o2.Hi1(ns1))
}