From 3b7032b1173ac1ea8c9ebb53bc48915857ebb201 Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Tue, 30 Mar 2021 17:51:56 -0500 Subject: [PATCH 1/2] removing schema related code moving into macschema project, and bridge related code moving into macbridge project --- Makefile | 5 - README.md | 60 +- bridge/bridge.go | 227 ------- bridge/host.go | 44 -- bridge/indicator.go | 54 -- bridge/menu.go | 117 ---- bridge/misc.go | 145 ----- bridge/resource/resource.go | 130 ---- bridge/window.go | 152 ----- cmd/macbridge/main.go | 12 - examples/_topframe/main.go | 1 + examples/bridgehost/main.go | 116 ---- go.mod | 6 - go.sum | 18 - objc/declparser/parser.go | 431 ------------- objc/declparser/parser_test.go | 466 -------------- objc/declparser/scanner.go | 161 ----- objc/demo-ios/MainWindow.xib | 143 ----- objc/demo-ios/demo.app/Info.plist | Bin 867 -> 0 bytes objc/demo-ios/demo.go | 36 -- objc/demo-ios/demoapp.bash | 14 - schema/NSApplication.json | 237 ------- schema/NSAutoreleasePool.json | 49 -- schema/NSColor.json | 169 ----- schema/NSMenu.json | 201 ------ schema/NSMenuItem.json | 145 ----- schema/NSScreen.json | 92 --- schema/NSStatusBar.json | 36 -- schema/NSStatusItem.json | 43 -- schema/NSWindow.json | 997 ----------------------------- schema/WKWebView.json | 231 ------- schema/WKWebViewConfiguration.json | 90 --- tools/schema/go.mod | 8 - tools/schema/go.sum | 18 - tools/schema/schema.go | 153 ----- 35 files changed, 2 insertions(+), 4805 deletions(-) delete mode 100644 bridge/bridge.go delete mode 100644 bridge/host.go delete mode 100644 bridge/indicator.go delete mode 100644 bridge/menu.go delete mode 100644 bridge/misc.go delete mode 100644 bridge/resource/resource.go delete mode 100644 bridge/window.go delete mode 100644 cmd/macbridge/main.go delete mode 100644 examples/bridgehost/main.go delete mode 100644 go.sum delete mode 100644 objc/declparser/parser.go delete mode 100644 objc/declparser/parser_test.go delete mode 100644 objc/declparser/scanner.go delete mode 100644 objc/demo-ios/MainWindow.xib delete mode 100644 objc/demo-ios/demo.app/Info.plist delete mode 100644 objc/demo-ios/demo.go delete mode 100755 objc/demo-ios/demoapp.bash delete mode 100644 schema/NSApplication.json delete mode 100644 schema/NSAutoreleasePool.json delete mode 100644 schema/NSColor.json delete mode 100644 schema/NSMenu.json delete mode 100644 schema/NSMenuItem.json delete mode 100644 schema/NSScreen.json delete mode 100644 schema/NSStatusBar.json delete mode 100644 schema/NSStatusItem.json delete mode 100644 schema/NSWindow.json delete mode 100644 schema/WKWebView.json delete mode 100644 schema/WKWebViewConfiguration.json delete mode 100644 tools/schema/go.mod delete mode 100644 tools/schema/go.sum delete mode 100644 tools/schema/schema.go diff --git a/Makefile b/Makefile index 53cb439a..114f52a2 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,3 @@ notification: ## build and run notification example pomodoro: ## build and run pomodoro example $(GOEXE) run ./examples/pomodoro .PHONY: pomodoro - -bridgehost: ## build and run bridgehost example - $(GOEXE) install ./cmd/macbridge - $(GOEXE) run ./examples/bridgehost -.PHONY: bridgehost \ No newline at end of file diff --git a/README.md b/README.md index 8d0f59fc..f801caa1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Native Mac APIs for Golang! ------ -MacDriver is a toolkit for working with Apple/Mac APIs and frameworks in Go. It currently has 3 "layers": +MacDriver is a toolkit for working with Apple/Mac APIs and frameworks in Go. It currently has 2 parts: ## 1. Bindings for Objective-C The `objc` package wraps the [Objective-C runtime](https://developer.apple.com/documentation/objectivec/objective-c_runtime?language=objc) to dynamically interact with Objective-C objects and classes: @@ -83,64 +83,6 @@ func main() { **NEW**: See [progrium/topframe](https://github.com/progrium/topframe) for a more fully-featured standalone version! -## 3. Bridge System -Lastly, a common case for this toolkit is not just building full native apps, but integrating Go applications -with Mac systems, like windows, native menus, status icons (systray), etc. -One-off libraries for some of these exist, but besides often limiting what you can do, -they're also just not composable. They all want to own the main thread! - -For this and other reasons, we often run the above kind of code in a separate process altogether from our -Go application. This might seem like a step backwards, but it is safer and more robust in a way. - -The `bridge` package takes advantage of this situation to create a higher-level abstraction more aligned with a potential -cross-platform toolkit. You can declaratively describe and modify structs that can be copied to the bridge process and applied to the Objective-C -objects in a manner similar to configuration management: - -```go -package main - -import ( - "os" - - "github.com/progrium/macdriver/bridge" -) - -func main() { - // start a bridge subprocess - host := bridge.NewHost(os.Stderr) - go host.Run() - - // create a window - window := bridge.Window{ - Title: "My Title", - Size: bridge.Size{W: 480, H: 240}, - Position: bridge.Point{X: 200, Y: 200}, - Closable: true, - Minimizable: false, - Resizable: false, - Borderless: false, - AlwaysOnTop: true, - Background: &bridge.Color{R: 1, G: 1, B: 1, A: 0.5}, - } - host.Sync(&window) - - // change its title - window.Title = "My New Title" - host.Sync(&window) - - // destroy the window - host.Release(&window) -} - -``` -This is the most WIP part of the project, but once developed further we can take this API and build a bridge -system with the same resources for Windows and Linux, making a cross-platform OS "driver". We'll see. - -* Current bridge types available: - * Window - * StatusItem (systray) - * Menu - ## Development Notes As far as we know, due to limitations of Go modules, we often need to add `replace` directives to our `go.mod` during development diff --git a/bridge/bridge.go b/bridge/bridge.go deleted file mode 100644 index c5f695f0..00000000 --- a/bridge/bridge.go +++ /dev/null @@ -1,227 +0,0 @@ -package bridge - -import ( - "context" - "fmt" - "io" - "os" - "reflect" - "sync" - - "github.com/manifold/qtalk/golang/mux" - "github.com/manifold/qtalk/golang/rpc" - "github.com/mitchellh/mapstructure" - "github.com/progrium/macdriver/bridge/resource" - "github.com/progrium/macdriver/cocoa" - "github.com/progrium/macdriver/core" - "github.com/progrium/macdriver/objc" -) - -var bridge *Bridge - -func init() { - fmt.Fprintln(os.Stderr, "registering...") - resource.RegisterType("win", reflect.TypeOf(Window{})) - resource.RegisterType("ind", reflect.TypeOf(Indicator{})) - resource.RegisterType("mnu", reflect.TypeOf(Menu{})) -} - -func Sync(p *rpc.Peer, v interface{}) error { - if !resource.HasHandle(v) { - return fmt.Errorf("not a resource") - } - handle := resource.GetHandle(v) - fmt.Println("get handle:", handle.Handle()) - if handle == nil { - // TODO: use proper registered prefix - handle = resource.NewHandle(reflect.ValueOf(v).Type().Elem().Name()) - fmt.Println("new handle:", handle.Handle()) - } - var h string - fmt.Println("sync:", handle.Handle()) - _, err := p.Call("Apply", []interface{}{*handle, v}, &h) - resource.SetHandle(v, h) - return err -} - -func Release(p *rpc.Peer, v interface{}) error { - if !resource.HasHandle(v) { - return fmt.Errorf("not a resource") - } - handle := resource.GetHandle(v) - fmt.Println("release:", handle.Handle()) - if handle == nil { - return fmt.Errorf("unable to release an uninitialized resource") - } - _, err := p.Call("Release", *handle, nil) - if err == nil { - resource.SetHandle(v, "") - } - return err -} - -func Run() { - bridge = NewBridge() - app := cocoa.NSApp_WithDidLaunch(func(n objc.Object) { - session := mux.NewSession(context.Background(), struct { - io.ReadCloser - io.Writer - }{os.Stdin, os.Stdout}) - peer := rpc.NewPeer(session, rpc.JSONCodec{}) - // peer.Bind("debug", debug) - peer.Bind("Apply", bridge.Apply) - peer.Bind("Release", bridge.Release) - //peer.Bind("Invoke", state.Invoke) - go peer.Respond() - }) - app.SetActivationPolicy(cocoa.NSApplicationActivationPolicyRegular) - app.ActivateIgnoringOtherApps(true) - app.Run() -} - -// func debug(handle string, data interface{}) string { -// return fmt.Sprintf("%#v", state.StatusItems[0].Menu) -// } - -// func newResource(h resource.Handle) (reflect.Value, error) { -// t, found := initTypes[h.Type()] -// if !found { -// return reflect.Value{}, fmt.Errorf("type not found") -// } -// return reflect.New(t), nil -// } - -func Invoke(ptr string) error { - // todo args - ef, ok := exportedFuncs[ptr] - // reflect call - if ok { - ef.fn.(func())() - } - return nil -} - -type Bridge struct { - Resources []interface{} - - objects map[resource.Handle]objc.Object - released map[resource.Handle]bool - - caller rpc.Caller - - sync.Mutex -} - -func NewBridge() *Bridge { - return &Bridge{ - objects: make(map[resource.Handle]objc.Object), - released: make(map[resource.Handle]bool), - } -} - -func (s *Bridge) Release(h resource.Handle) (err error) { - s.Lock() - s.released[h] = true - core.Dispatch(func() { - //fmt.Fprintf(os.Stderr, "RECONCILING %v\n", handle) - if err := s.Reconcile(); err != nil { - fmt.Fprintln(os.Stderr, err) - } - s.Unlock() - }) - // TODO: remove from State slices - return nil -} - -func (s *Bridge) Apply(h string, patch map[string]interface{}, call *rpc.Call) (resource.Handle, error) { - s.Lock() - handle := resource.Handle(h) - fmt.Fprintln(os.Stderr, "handle:", handle, handle.Prefix(), handle.ID()) - - Walk(patch, func(v, p reflect.Value, path []string) error { - if path[len(path)-1] == "$fnptr" { - p.SetMapIndex(reflect.ValueOf("Caller"), reflect.ValueOf(call.Caller)) - } - return nil - }) - - v, err := s.Lookup(handle) - if err != nil { - return handle, err - } - if !v.IsValid() { - // var err error - v = reflect.ValueOf(resource.New(handle.Prefix())) - // if err != nil { - // return handle, err - // } - resource.SetHandle(v.Interface(), handle.Handle()) - delete(patch, "Handle") - } - if err := mapstructure.Decode(patch, v.Interface()); err != nil { - return handle, err - } - s.Resources = append(s.Resources, v.Interface()) - - core.Dispatch(func() { - //fmt.Fprintf(os.Stderr, "RECONCILING %v\n", handle) - if err := s.Reconcile(); err != nil { - fmt.Fprintln(os.Stderr, err) - } - s.Unlock() - }) - return handle, err -} - -func (s *Bridge) Lookup(handle resource.Handle) (found reflect.Value, err error) { - for _, r := range s.Resources { - if !resource.HasHandle(r) { - continue - } - h := resource.GetHandle(r) - if h != nil && *h == handle { - found = reflect.ValueOf(r) - return found, err - } - } - return found, err -} - -func (s *Bridge) Reconcile() error { - for _, r := range s.Resources { - if !resource.HasHandle(r) { - continue - } - h := resource.GetHandle(r) - if h != nil { - target, exists := s.objects[*h] - if s.released[*h] { - // if in released but not in objects, - // its stale state that should have been cleaned up - // so we will ignore it here - if !exists { - continue - } - rd, ok := r.(resource.Discarder) - if ok && target != nil { - if err := rd.Discard(target); err != nil { - //delete(s.objects, *h) - return err - } - } - delete(s.objects, *h) - continue - } - ra, ok := r.(resource.Applier) - if ok { - var err error - target, err = ra.Apply(target) - if err != nil { - return err - } - s.objects[*h] = target - } - } - } - return nil -} diff --git a/bridge/host.go b/bridge/host.go deleted file mode 100644 index 6ecc71ec..00000000 --- a/bridge/host.go +++ /dev/null @@ -1,44 +0,0 @@ -package bridge - -import ( - "context" - "io" - "os" - "os/exec" - - "github.com/manifold/qtalk/golang/mux" - "github.com/manifold/qtalk/golang/rpc" -) - -type Host struct { - Cmd *exec.Cmd - Pipe io.ReadWriteCloser - Peer *rpc.Peer -} - -func (h *Host) Run() error { - return h.Cmd.Run() -} - -func NewHost(stderr io.Writer) (*Host, error) { - bridgecmd := os.Getenv("BRIDGECMD") - if bridgecmd == "" { - bridgecmd = "macbridge" - } - cmd := exec.Command(bridgecmd) - cmd.Stderr = stderr - wc, inErr := cmd.StdinPipe() - if inErr != nil { - return nil, inErr - } - rc, outErr := cmd.StdoutPipe() - if outErr != nil { - return nil, outErr - } - pipe := struct { - io.WriteCloser - io.Reader - }{wc, rc} - session := mux.NewSession(context.Background(), pipe) - return &Host{Cmd: cmd, Pipe: pipe, Peer: rpc.NewPeer(session, rpc.JSONCodec{})}, nil -} diff --git a/bridge/indicator.go b/bridge/indicator.go deleted file mode 100644 index 8bfc9bbb..00000000 --- a/bridge/indicator.go +++ /dev/null @@ -1,54 +0,0 @@ -package bridge - -import ( - "encoding/base64" - - "github.com/progrium/macdriver/bridge/resource" - "github.com/progrium/macdriver/cocoa" - "github.com/progrium/macdriver/core" - "github.com/progrium/macdriver/objc" -) - -type Indicator struct { - *resource.Handle // ind: - - Icon string - Text string - Menu *Menu -} - -func (s *Indicator) Apply(target objc.Object) (objc.Object, error) { - obj := cocoa.NSStatusItem{Object: target} - if target == nil { - obj = cocoa.NSStatusBar_System().StatusItemWithLength(cocoa.NSVariableStatusItemLength) - obj.Retain() - target = obj.Object - } - obj.Button().SetTitle(s.Text) - if s.Icon != "" { - b, err := base64.StdEncoding.DecodeString(s.Icon) - if err != nil { - return nil, err - } - data := core.NSData_WithBytes(b, uint64(len(b))) - image := cocoa.NSImage_InitWithData(data) - image.SetSize(core.Size(16.0, 16.0)) - image.SetTemplate(true) - obj.Button().SetImage(image) - if s.Text != "" { - obj.Button().SetImagePosition(cocoa.NSImageLeft) - } else { - obj.Button().SetImagePosition(cocoa.NSImageOnly) - } - - } - if s.Menu != nil { - var menu objc.Object - var err error - if menu, err = s.Menu.Apply(menu); err != nil { - return nil, err - } - obj.SetMenu(cocoa.NSMenu{Object: menu}) - } - return target, nil -} diff --git a/bridge/menu.go b/bridge/menu.go deleted file mode 100644 index 76f6af38..00000000 --- a/bridge/menu.go +++ /dev/null @@ -1,117 +0,0 @@ -package bridge - -import ( - "encoding/base64" - "fmt" - "os" - - "github.com/manifold/qtalk/golang/rpc" - "github.com/progrium/macdriver/bridge/resource" - "github.com/progrium/macdriver/cocoa" - "github.com/progrium/macdriver/core" - "github.com/progrium/macdriver/objc" - "github.com/rs/xid" -) - -type Menu struct { - *resource.Handle /// men: - - Icon string - Title string - Tooltip string - Items []MenuItem -} - -func (m *Menu) Apply(target objc.Object) (objc.Object, error) { - if target == nil { - menu := cocoa.NSMenu_New() - menu.SetAutoenablesItems(true) - for _, i := range m.Items { - menu.AddItem(i.NSMenuItem()) - } - target = menu.Object - } - return target, nil -} - -type rpc_FuncExport struct { - Ptr string `json:"$fnptr" mapstructure:"$fnptr"` - Caller rpc.Caller - fn interface{} -} - -func (e *rpc_FuncExport) Call(args, reply interface{}) error { - _, err := e.Caller.Call("Invoke", e.Ptr, reply) - return err -} - -func (e *rpc_FuncExport) Callback() (objc.Object, objc.Selector) { - ee := *e - return core.Callback(func(o objc.Object) { - err := ee.Call(nil, nil) - if err != nil { - fmt.Fprintf(os.Stderr, "callback: %v\n", err) - } - }) -} - -var exportedFuncs map[string]rpc_FuncExport - -func ExportFunc(fn interface{}) *rpc_FuncExport { - if exportedFuncs == nil { - exportedFuncs = make(map[string]rpc_FuncExport) - } - id := xid.New().String() - ef := rpc_FuncExport{ - Ptr: id, - fn: fn, - } - exportedFuncs[id] = ef - return &ef -} - -type MenuItem struct { - *resource.Handle // mit: - - Title string - Icon string - Tooltip string - Separator bool - Enabled bool - Checked bool - - OnClick *rpc_FuncExport - // TODO: submenus -} - -func (i *MenuItem) NSMenuItem() cocoa.NSMenuItem { - if i.Separator { - return cocoa.NSMenuItem_Separator() - } - obj := cocoa.NSMenuItem_New() - obj.SetTitle(i.Title) - obj.SetEnabled(i.Enabled) - obj.SetToolTip(i.Tooltip) - if i.Checked { - obj.SetState(cocoa.NSControlStateValueOn) - } - if i.Icon != "" { - b, err := base64.StdEncoding.DecodeString(i.Icon) - if err == nil { - data := core.NSData_WithBytes(b, uint64(len(b))) - img := cocoa.NSImage_InitWithData(data) - img.SetSize(core.Size(16, 16)) - obj.SetImage(img) - } - } - if i.Title == "Quit" { - obj.SetTarget(cocoa.NSApp()) - obj.SetAction(objc.Sel("terminate:")) - } - if i.OnClick != nil && i.OnClick.Caller != nil { - t, sel := i.OnClick.Callback() - obj.SetTarget(t) - obj.SetAction(sel) - } - return obj -} diff --git a/bridge/misc.go b/bridge/misc.go deleted file mode 100644 index 2163d6db..00000000 --- a/bridge/misc.go +++ /dev/null @@ -1,145 +0,0 @@ -package bridge - -import ( - "fmt" - "os" - "reflect" - "sort" - "strconv" - "strings" - - "github.com/progrium/macdriver/cocoa" - "github.com/progrium/macdriver/core" -) - -type Point struct { - X float64 - Y float64 -} - -func (p *Point) NSPoint() core.NSPoint { - return core.NSPoint{X: p.X, Y: p.Y} -} - -type Size struct { - W float64 - H float64 -} - -func (s *Size) NSSize() core.NSSize { - return core.NSSize{Width: s.W, Height: s.H} -} - -type Color struct { - R float64 - G float64 - B float64 - A float64 -} - -func (c *Color) NSColor() cocoa.NSColor { - return cocoa.NSColor_Init(c.R, c.G, c.B, c.A) -} - -//////// unused? - -func walk(v reflect.Value, path []string, visitor func(v reflect.Value, parent reflect.Value, path []string) error) error { - for _, k := range keys(v) { - subpath := append(path, k) - vv := prop(v, k) - if !vv.IsValid() { - continue - } - if err := visitor(vv, v, subpath); err != nil { - return err - } - if err := walk(vv, subpath, visitor); err != nil { - return err - } - } - return nil -} - -func Walk(v interface{}, visitor func(v reflect.Value, parent reflect.Value, path []string) error) error { - return walk(reflect.ValueOf(v), []string{}, visitor) -} - -func prop(robj reflect.Value, key string) reflect.Value { - rtyp := robj.Type() - switch rtyp.Kind() { - case reflect.Slice, reflect.Array: - idx, err := strconv.Atoi(key) - if err != nil { - panic("non-numeric index given for slice") - } - rval := robj.Index(idx) - if rval.IsValid() { - return reflect.ValueOf(rval.Interface()) - } - case reflect.Ptr: - return prop(robj.Elem(), key) - case reflect.Map: - rval := robj.MapIndex(reflect.ValueOf(key)) - if rval.IsValid() { - return reflect.ValueOf(rval.Interface()) - } - case reflect.Struct: - rval := robj.FieldByName(key) - if rval.IsValid() { - return rval - } - for i := 0; i < rtyp.NumField(); i++ { - field := rtyp.Field(i) - tag := strings.Split(field.Tag.Get("json"), ",") - if tag[0] == key || field.Name == key { - return robj.FieldByName(field.Name) - } - } - panic("struct field not found: " + key) - } - //spew.Dump(robj, key) - panic("unexpected kind: " + rtyp.Kind().String()) -} - -func keys(v reflect.Value) []string { - switch v.Type().Kind() { - case reflect.Map: - var keys []string - for _, key := range v.MapKeys() { - k, ok := key.Interface().(string) - if !ok { - continue - } - keys = append(keys, k) - } - sort.Sort(sort.StringSlice(keys)) - return keys - case reflect.Struct: - t := v.Type() - var f []string - for i := 0; i < t.NumField(); i++ { - name := t.Field(i).Name - // first letter capitalized means exported - if name[0] == strings.ToUpper(name)[0] { - f = append(f, name) - } - } - return f - case reflect.Slice, reflect.Array: - var k []string - for n := 0; n < v.Len(); n++ { - k = append(k, strconv.Itoa(n)) - } - return k - case reflect.Ptr: - if !v.IsNil() { - return keys(v.Elem()) - } - return []string{} - case reflect.String, reflect.Bool, reflect.Float64, reflect.Float32, reflect.Interface: - return []string{} - default: - fmt.Fprintf(os.Stderr, "unexpected type: %s\n", v.Type().Kind()) - return []string{} - } -} diff --git a/bridge/resource/resource.go b/bridge/resource/resource.go deleted file mode 100644 index 8e93609a..00000000 --- a/bridge/resource/resource.go +++ /dev/null @@ -1,130 +0,0 @@ -package resource - -import ( - "fmt" - "log" - "os" - "reflect" - "strings" - - "github.com/progrium/macdriver/objc" - "github.com/rs/xid" -) - -var registeredTypes map[string]reflect.Type - -func init() { - registeredTypes = make(map[string]reflect.Type) -} - -type Applier interface { - Apply(objc.Object) (objc.Object, error) -} - -type Discarder interface { - Discard(objc.Object) error -} - -func TypePrefix(v interface{}) string { - rt := reflect.Indirect(reflect.ValueOf(v)).Type() - for p, t := range registeredTypes { - if t == rt { - return p - } - } - log.Panicf("type '%v' not registered resource", rt) - return "" -} - -func RegisterType(prefix string, rtype reflect.Type) { - registeredTypes[prefix] = rtype -} - -func New(prefix string) interface{} { - t, ok := registeredTypes[prefix] - if !ok { - log.Panicf("resource type not registered: %s", prefix) - } - h := NewHandle(prefix) - r := reflect.New(t).Elem().Interface() - SetHandle(r, h.Handle()) - return r -} - -type Handle string - -func NewHandle(prefix string) *Handle { - handle := Handle(fmt.Sprintf("%s:%s", prefix, xid.New().String())) - return &handle -} - -func HasHandle(v interface{}) bool { - rv := reflect.Indirect(reflect.ValueOf(v)) - if rv.Kind() == reflect.Struct && rv.Type().NumField() > 0 && rv.Type().Field(0).Name == "Handle" { - return true - } - return false -} - -func GetHandle(v interface{}) *Handle { - if !HasHandle(v) { - return nil - } - rv := reflect.Indirect(reflect.ValueOf(v)) - h := rv.Field(0).Interface() - hh, ok := h.(*Handle) - if !ok { - return nil - } - if hh.Prefix() == "" { - hh = NewHandle(TypePrefix(v)) - } - return hh -} - -// if "" => prefix: -// if id => prefix:id -// if prefix:id => prefix:id -func SetHandle(v interface{}, h string) { - if !HasHandle(v) { - return - } - if !strings.Contains(h, ":") { - if h == "" { - h = fmt.Sprintf("%s:", TypePrefix(v)) - } else { - h = fmt.Sprintf("%s:%s", TypePrefix(v), h) - } - } - handle := Handle(h) - ptr := reflect.ValueOf(&handle) - res := reflect.Indirect(reflect.ValueOf(v)) - res.Field(0).Set(ptr) - fmt.Fprintln(os.Stderr, "sethandle:", v, handle.Handle()) -} - -func (h *Handle) Prefix() string { - if h == nil { - return "" - } - parts := strings.Split(string(*h), ":") - return parts[0] -} - -func (h *Handle) ID() string { - if h == nil { - return "" - } - parts := strings.Split(string(*h), ":") - if len(parts) > 1 { - return parts[1] - } - return "" -} - -func (h *Handle) Handle() string { - if h == nil { - return "" - } - return string(*h) -} diff --git a/bridge/window.go b/bridge/window.go deleted file mode 100644 index d2000308..00000000 --- a/bridge/window.go +++ /dev/null @@ -1,152 +0,0 @@ -package bridge - -import ( - "encoding/base64" - - "github.com/progrium/macdriver/bridge/resource" - "github.com/progrium/macdriver/cocoa" - "github.com/progrium/macdriver/core" - "github.com/progrium/macdriver/objc" - "github.com/progrium/macdriver/webkit" -) - -type Window struct { - *resource.Handle // win: - - Title string - Position Point - Size Size - Closable bool - Minimizable bool - Resizable bool - Background *Color - Borderless bool - CornerRadius float64 - AlwaysOnTop bool - IgnoreMouse bool - Center bool - URL string - Image string - - webview *webkit.WKWebView - image *cocoa.NSImage -} - -func (w *Window) Discard(target objc.Object) error { - obj := cocoa.NSWindow{Object: target} - obj.Close() - return nil -} - -func (w *Window) Apply(target objc.Object) (objc.Object, error) { - frame := core.Rect(w.Position.X, w.Position.Y, w.Size.W, w.Size.H) - if target == nil { - win := cocoa.NSWindow_Init(core.Rect(0, 0, 0, 0), cocoa.NSTitledWindowMask, cocoa.NSBackingStoreBuffered, false) - win.Retain() - win.MakeKeyAndOrderFront(nil) - target = win.Object - if w.Center { - screenRect := cocoa.NSScreen_Main().Frame() - frame = core.Rect( - (screenRect.Size.Width/2)-(w.Size.W/2), - (screenRect.Size.Height/2)-(w.Size.H/2), - w.Size.W, - w.Size.H, - ) - } - } - obj := cocoa.NSWindow{Object: target} - - if w.URL != "" && w.webview == nil { - config := webkit.WKWebViewConfiguration_New() - config.Preferences().SetValueForKey(core.True, core.String("developerExtrasEnabled")) - - wv := webkit.WKWebView_Init(core.Rect(0, 0, w.Size.W, w.Size.H), config) - w.webview = &wv - - req := core.NSURLRequest_Init(core.URL(w.URL)) - wv.LoadRequest(req) - } - - if w.Image != "" && w.image == nil { - b, err := base64.StdEncoding.DecodeString(w.Image) - if err != nil { - return nil, err - } - data := core.NSData_WithBytes(b, uint64(len(b))) - image := cocoa.NSImage_InitWithData(data) - w.image = &image - } - - mask := cocoa.NSTitledWindowMask - needsTitleBar := w.Closable || w.Minimizable - if w.Borderless { - if !needsTitleBar { - mask = cocoa.NSBorderlessWindowMask - } - mask = mask | cocoa.NSFullSizeContentViewWindowMask - } - if w.Closable { - mask = mask | cocoa.NSClosableWindowMask - } - if w.Minimizable { - mask = mask | cocoa.NSMiniaturizableWindowMask - } - if w.Resizable { - mask = mask | cocoa.NSResizableWindowMask - } - obj.SetStyleMask(mask) - - if w.Title != "" { - obj.SetTitle(w.Title) - } else { - obj.SetMovableByWindowBackground(true) - obj.SetTitlebarAppearsTransparent(true) - } - - if w.Borderless && w.CornerRadius > 0 { - obj.SetBackgroundColor(cocoa.NSColor_Clear()) - obj.SetOpaque(false) - v := cocoa.NSView_Init(core.Rect(0, 0, 0, 0)) - if w.Background != nil { - v.SetBackgroundColor(w.Background.NSColor()) - } - v.SetWantsLayer(true) - v.Layer().SetCornerRadius(w.CornerRadius) - - if w.webview != nil { - v.AddSubviewPositionedRelativeTo(*w.webview, cocoa.NSWindowAbove, nil) - } - obj.SetContentView(v) - } else { - if w.Background != nil { - obj.SetBackgroundColor(w.Background.NSColor()) - obj.SetOpaque(w.Background.A == 1) - } - if w.webview != nil { - obj.SetContentView(*w.webview) - } - } - - if w.webview != nil && w.Background != nil && w.Background.A == 0 { - w.webview.SetOpaque(false) - w.webview.SetBackgroundColor(cocoa.NSColor_Clear()) - w.webview.SetValueForKey(core.False, core.String("drawsBackground")) - } - - if w.image != nil { - obj.ContentView().SetWantsLayer(true) - obj.ContentView().Layer().SetContents(w.image) - } - - if w.AlwaysOnTop { - obj.SetLevel(cocoa.NSMainMenuWindowLevel) - } - - if w.IgnoreMouse { - obj.SetIgnoresMouseEvents(true) - } - - obj.SetFrameDisplay(frame, true) - return target, nil -} diff --git a/cmd/macbridge/main.go b/cmd/macbridge/main.go deleted file mode 100644 index d062d5b5..00000000 --- a/cmd/macbridge/main.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "runtime" - - "github.com/progrium/macdriver/bridge" -) - -func main() { - runtime.LockOSThread() - bridge.Run() -} diff --git a/examples/_topframe/main.go b/examples/_topframe/main.go index 7d67fea9..1536b829 100644 --- a/examples/_topframe/main.go +++ b/examples/_topframe/main.go @@ -1,3 +1,4 @@ +// +build go1.6 package main import ( diff --git a/examples/bridgehost/main.go b/examples/bridgehost/main.go deleted file mode 100644 index 95566aff..00000000 --- a/examples/bridgehost/main.go +++ /dev/null @@ -1,116 +0,0 @@ -package main - -import ( - "encoding/base64" - "fmt" - "io/ioutil" - "log" - "os" - "time" - - "github.com/progrium/macdriver/bridge" -) - -func main() { - h, err := bridge.NewHost(os.Stderr) - if err != nil { - log.Fatal(err) - } - go h.Run() - - data, err := ioutil.ReadFile("/Users/progrium/Source/github.com/manifold/tractor/data/icons/tractor_dark.ico") - if err != nil { - log.Fatal(err) - } - - h.Peer.Bind("Invoke", bridge.Invoke) - go h.Peer.Respond() - - window := bridge.Window{ - Title: "Hello 1", - Size: bridge.Size{W: 480, H: 240}, - Position: bridge.Point{X: 200, Y: 200}, - Closable: true, - Minimizable: false, - Resizable: false, - Borderless: false, - // Image: base64.StdEncoding.EncodeToString(data), - // Background: &Color{R: 0, G: 0, B: 1, A: 0.5}, - } - if err := bridge.Sync(h.Peer, &window); err != nil { - log.Fatal(err) - } - - window2 := bridge.Window{ - Title: "Hello 2", - Size: bridge.Size{W: 480, H: 240}, - Position: bridge.Point{X: 400, Y: 200}, - Closable: true, - Minimizable: false, - Resizable: false, - Borderless: false, - // Image: base64.StdEncoding.EncodeToString(data), - // Background: &Color{R: 0, G: 0, B: 1, A: 0.5}, - } - if err := bridge.Sync(h.Peer, &window2); err != nil { - log.Fatal(err) - } - - if err := bridge.Release(h.Peer, &window); err != nil { - log.Fatal(err) - } - - window3 := bridge.Window{ - Title: "Hello 3", - Size: bridge.Size{W: 480, H: 240}, - Position: bridge.Point{X: 500, Y: 200}, - Closable: true, - Minimizable: false, - Resizable: false, - Borderless: false, - // Image: base64.StdEncoding.EncodeToString(data), - // Background: &Color{R: 0, G: 0, B: 1, A: 0.5}, - } - if err := bridge.Sync(h.Peer, &window3); err != nil { - log.Fatal(err) - } - - systray := bridge.Indicator{ - Menu: &bridge.Menu{ - Items: []bridge.MenuItem{ - {Title: "Bar", Enabled: true, OnClick: bridge.ExportFunc(func() { - fmt.Println("Bar clicked") - })}, - {Title: "Foo", Enabled: true, OnClick: bridge.ExportFunc(func() { - fmt.Println("Foo clicked") - })}, - {Separator: true}, - {Title: "Quit", Enabled: true}, - }, - }, - Icon: base64.StdEncoding.EncodeToString(data), - } - if err := bridge.Sync(h.Peer, &systray); err != nil { - log.Fatal(err) - } - - time.Sleep(4 * time.Second) - - systray.Text = "Hello" - systray.Menu.Items = []bridge.MenuItem{ - {Title: "Zar", Enabled: true, OnClick: bridge.ExportFunc(func() { - fmt.Println("Zar clicked") - })}, - {Title: "Zoo", Enabled: false}, - {Separator: true}, - {Title: "Shutdown", Enabled: true, OnClick: bridge.ExportFunc(func() { - fmt.Println("shutdown") - })}, - } - if err := bridge.Sync(h.Peer, &systray); err != nil { - log.Fatal(err) - } - - select {} - -} diff --git a/go.mod b/go.mod index 7aa1ae4f..e5832388 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,3 @@ module github.com/progrium/macdriver go 1.15 - -require ( - github.com/manifold/qtalk v0.1.0 - github.com/mitchellh/mapstructure v1.4.0 - github.com/rs/xid v1.2.1 -) diff --git a/go.sum b/go.sum deleted file mode 100644 index cd66f7d8..00000000 --- a/go.sum +++ /dev/null @@ -1,18 +0,0 @@ -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/manifold/qtalk v0.1.0 h1:WgmxGC3t0LnVfUKr0E6FR1PUq9fsUJisMmyXHawLCJc= -github.com/manifold/qtalk v0.1.0/go.mod h1:UX1KjRclAJyV+ydrpEO1CnF8x95Le/Adx8BMGPJaYqg= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/webview/webview v0.0.0-20200724072439-e0c01595b361/go.mod h1:rpXAuuHgyEJb6kXcXldlkOjU6y4x+YcASKKXJNUhh0Y= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/vmihailenco/msgpack.v2 v2.9.1/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn+AEGwNEOatn8= diff --git a/objc/declparser/parser.go b/objc/declparser/parser.go deleted file mode 100644 index 7bbc9089..00000000 --- a/objc/declparser/parser.go +++ /dev/null @@ -1,431 +0,0 @@ -package declparser - -import ( - "bufio" - "bytes" - "fmt" - "io" - "strings" -) - -type Statement struct { - Method *MethodDecl - Property *PropertyDecl - Interface *InterfaceDecl -} - -func (s Statement) String() string { - if s.Method != nil { - return s.Method.String() - } - if s.Property != nil { - return s.Property.String() - } - - if s.Interface != nil { - return s.Interface.String() - } - return "" -} - -type InterfaceDecl struct { - Name string - SuperName string -} - -func (i InterfaceDecl) String() string { - b := &strings.Builder{} - _, _ = fmt.Fprintf(b, "@interface %s", i.Name) - if i.SuperName != "" { - _, _ = fmt.Fprintf(b, " : %s", i.SuperName) - } - return b.String() -} - -type PropertyDecl struct { - TypeProperty bool // class property - Readonly bool - Weak bool - Nonatomic bool - Copy bool - Getter string - Setter string - Name string - Type TypeInfo -} - -func (p PropertyDecl) String() string { - b := &strings.Builder{} - b.WriteString("@property") - var options []string - if p.Setter != ""{ - options = append(options, fmt.Sprintf("setter=%s", p.Setter)) - } - if p.Getter != "" { - options = append(options, fmt.Sprintf("getter=%s", p.Getter)) - } - if p.TypeProperty { - options = append(options, "class") - } - if p.Readonly { - options = append(options, "readonly") - } - if p.Copy { - options = append(options, "copy") - } - if p.Nonatomic { - options = append(options, "nonatomic") - } - if p.Weak { - options = append(options, "weak") - } - if len(options) != 0 { - b.WriteString("(") - b.WriteString(strings.Join(options, ", ")) - b.WriteString(")") - } - - b.WriteString(" ") - b.WriteString(p.Type.Name) - b.WriteString(" ") - if p.Type.IsPtr { - b.WriteString("*") - } - b.WriteString(p.Name) - b.WriteString(";") - return b.String() -} - -type MethodDecl struct { - TypeMethod bool // instance method otherwise - ReturnType TypeInfo - NameParts []string - Args []ArgInfo -} - -func (m *MethodDecl) Name() string { - if len(m.NameParts) == 0 { - return "" - } - if len(m.NameParts) == 1 { - return m.NameParts[0] - } - return strings.Join(append(m.NameParts, ""), ":") -} - -func (m MethodDecl) String() string { - b := &strings.Builder{} - if m.TypeMethod { - b.WriteString("+") - }else { - b.WriteString("-") - } - b.WriteString(" ") - b.WriteString(fmt.Sprintf("(%s)", m.ReturnType.String())) - b.WriteString(m.NameParts[0]) - for i, arg := range m.Args { - if i != 0 { - b.WriteString(" \n") - b.WriteString(m.NameParts[i]) - } - b.WriteString(":") - b.WriteString(arg.String()) - - } - b.WriteString(";") - return b.String() -} - -type TypeInfo struct { - Name string - IsPtr bool -} - -func (t TypeInfo) String() string { - b := &strings.Builder{} - b.WriteString(t.Name) - if t.IsPtr { - b.WriteString(" *") - } - return b.String() -} - -type ArgInfo struct { - Name string - Type TypeInfo -} - -func (arg ArgInfo) String() string { - b := &strings.Builder{} - b.WriteString(fmt.Sprintf("(%s)", arg.Type.String())) - b.WriteString(arg.Name) - return b.String() -} - -type Parser struct { - s *scanner - buf struct { - tok token // last read token - lit string // last read literal - n int // buffer size (max=1) - } -} - -func NewParser(r io.Reader) *Parser { - return &Parser{s: &scanner{r: bufio.NewReader(r)}} -} - -func NewStringParser(s string) *Parser { - return &Parser{s: &scanner{r: bufio.NewReader(bytes.NewBufferString(s))}} -} - -// scan returns the next token from the underlying scanner. -// If a token has been unscanned then read that instead. -func (p *Parser) scan() (tok token, lit string) { - if p.buf.n != 0 { - p.buf.n = 0 - return p.buf.tok, p.buf.lit - } - - tok, lit = p.s.Scan() - - // ignore whitespace - if tok == WS { - tok, lit = p.s.Scan() - } - - p.buf.tok, p.buf.lit = tok, lit - - return -} - -func (p *Parser) unscan() { p.buf.n = 1 } - -// scanType will scan a typeInfo -func (p *Parser) scanType() (*TypeInfo, error) { - ti := &TypeInfo{} - - if tok, lit := p.scan(); tok != LEFTPAREN { - return nil, fmt.Errorf("found %q, expected (", lit) - } - - tok, lit := p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected identifier", lit) - } - ti.Name = lit - - tok, lit = p.scan() - if tok == ASTERISK { - ti.IsPtr = true - } else { - p.unscan() - } - - if tok, lit := p.scan(); tok != RIGHTPAREN { - return nil, fmt.Errorf("found %q, expected )", lit) - } - - return ti, nil -} - -func (p *Parser) Parse() (*Statement, error) { - tok, lit := p.scan() - switch tok { - case PLUS, MINUS: - p.unscan() - decl, err := p.parseMethod() - return &Statement{Method: decl}, err - case PROPERTY: - decl, err := p.parseProperty() - return &Statement{Property: decl}, err - case INTERFACE: - decl, err := p.parseInterface() - return &Statement{Interface: decl}, err - default: - return nil, fmt.Errorf("found %q, expected method (+,-) or keyword (@...)", lit) - } -} - -func (p *Parser) parseProperty() (*PropertyDecl, error) { - decl := &PropertyDecl{} - - tok, lit := p.scan() - if tok == LEFTPAREN { - for { - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected property attribute", lit) - } - - switch lit { - case "readwrite": - // readwrite is opposite of readonly, - // this is the default, so no-op - case "readonly": - decl.Readonly = true - case "class": - decl.TypeProperty = true - case "strong": - // strong is opposite of weak, - // this is the default, so no-op - case "weak": - decl.Weak = true - case "copy": - decl.Copy = true - case "assign": - // another default, no-ops - case "nonatomic": - decl.Nonatomic = true - case "setter": - tok, lit = p.scan() - if tok != EQUAL { - return nil, fmt.Errorf("found %q, expected =", lit) - } - - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected setter identifier", lit) - } - decl.Setter = lit - case "getter": - tok, lit = p.scan() - if tok != EQUAL { - return nil, fmt.Errorf("found %q, expected =", lit) - } - - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected getter identifier", lit) - } - decl.Getter = lit - default: - return nil, fmt.Errorf("found %q, unrecognized property attribute", lit) - } - - tok, lit = p.scan() - if tok == RIGHTPAREN { - break - } - if tok != COMMA { - return nil, fmt.Errorf("found %q, expected , or )", lit) - } - } - } else { - p.unscan() - } - - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected type identifier", lit) - } - decl.Type.Name = lit - - tok, lit = p.scan() - if tok == ASTERISK { - decl.Type.IsPtr = true - } else { - p.unscan() - } - - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected name identifier", lit) - } - decl.Name = lit - - tok, lit = p.scan() - if tok != SEMICOLON { - return nil, fmt.Errorf("found %q, expected ;", lit) - } - - return decl, nil -} - -func (p *Parser) parseInterface() (*InterfaceDecl, error) { - decl := &InterfaceDecl{} - - tok, lit := p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected identifier", lit) - } - decl.Name = lit - - tok, lit = p.scan() - if tok == COLON { - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected identifier", lit) - } - decl.SuperName = lit - } else { - p.unscan() - } - - return decl, nil -} - -func (p *Parser) parseMethod() (*MethodDecl, error) { - decl := &MethodDecl{} - - tok, lit := p.scan() - switch tok { - case PLUS: - decl.TypeMethod = true - case MINUS: - decl.TypeMethod = false - default: - return nil, fmt.Errorf("found %q, expected + or -", lit) - } - - typ, err := p.scanType() - if err != nil { - return nil, err - } - decl.ReturnType = *typ - - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected identifier", lit) - } - decl.NameParts = append(decl.NameParts, lit) - - tok, lit = p.scan() - if tok == SEMICOLON { - return decl, nil - } else if tok == COLON { - for { - arg := ArgInfo{} - - typ, err := p.scanType() - if err != nil { - return nil, err - } - arg.Type = *typ - - tok, lit = p.scan() - if tok != IDENT { - return nil, fmt.Errorf("found %q, expected identifier", lit) - } - arg.Name = lit - - decl.Args = append(decl.Args, arg) - - tok, lit = p.scan() - if tok == SEMICOLON { - return decl, nil - } else if tok == IDENT { - decl.NameParts = append(decl.NameParts, lit) - - tok, lit = p.scan() - if tok != COLON { - return nil, fmt.Errorf("found %q, expected :", lit) - } - } else { - return nil, fmt.Errorf("found %q, expected ; or more arguments", lit) - } - } - } else { - return nil, fmt.Errorf("found %q, expected : or ;", lit) - } -} diff --git a/objc/declparser/parser_test.go b/objc/declparser/parser_test.go deleted file mode 100644 index 6b4ffd7f..00000000 --- a/objc/declparser/parser_test.go +++ /dev/null @@ -1,466 +0,0 @@ -package declparser - -import ( - "bytes" - "reflect" - "testing" -) - - -func TestParser_Parse(t *testing.T) { - tests := []struct { - name string - input string - want *Statement - wantErr bool - }{ - { - name: "empty input errors", - input: "", - want: nil, - wantErr: true, - }, - { - name: "interface with super class", - input: `@interface NSMenu : NSObject`, - want: &Statement{ - Interface: &InterfaceDecl{ - Name: "NSMenu", - SuperName: "NSObject", - }, - }, - }, - { - name: "type method", - input: `+ (BOOL)menuBarVisible;`, - want: &Statement{ - Method: &MethodDecl{ - TypeMethod: true, - NameParts: []string{"menuBarVisible"}, - ReturnType: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - { - name: "type method with one arg", - input: `+ (void)setMenuBarVisible:(BOOL)visible;`, - want: &Statement{ - Method: &MethodDecl{ - TypeMethod: true, - ReturnType: TypeInfo{ - Name: "void", - }, - NameParts: []string{"setMenuBarVisible"}, - Args: []ArgInfo{ - { - Name: "visible", - Type: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - }, - }, - { - name: "instance method", - input: `- (NSRect)convertRectToBacking:(NSRect)rect;`, - want: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "NSRect", - }, - NameParts: []string{"convertRectToBacking"}, - Args: []ArgInfo{ - { - Name: "rect", - Type: TypeInfo{ - Name: "NSRect", - }, - }, - }, - }, - }, - }, - { - name: "instance method with pointer return and arg", - input: `- (NSColor *)blendedColorWithFraction:(CGFloat)fraction - ofColor:(NSColor *)color;`, - want: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "NSColor", - IsPtr: true, - }, - NameParts: []string{"blendedColorWithFraction", "ofColor"}, - Args: []ArgInfo{ - { - Name: "fraction", - Type: TypeInfo{ - Name: "CGFloat", - }, - }, - { - Name: "color", - Type: TypeInfo{ - Name: "NSColor", - IsPtr: true, - }, - }, - }, - }, - }, - }, - { - name: "instance method with no arg and void return", - input: `- (void)resetCursorRects;`, - want: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "void", - }, - NameParts: []string{"resetCursorRects"}, - }, - }, - }, - { - name: "instance method with more than one arg", - input: `- (instancetype)initWithContentRect:(NSRect)contentRect - styleMask:(NSWindowStyleMask)style - backing:(NSBackingStoreType)backingStoreType - defer:(BOOL)flag;`, - want: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "instancetype", - }, - NameParts: []string{"initWithContentRect", "styleMask", "backing", "defer"}, - Args: []ArgInfo{ - { - Name: "contentRect", - Type: TypeInfo{ - Name: "NSRect", - }, - }, { - Name: "style", - Type: TypeInfo{ - Name: "NSWindowStyleMask", - }, - }, { - Name: "backingStoreType", - Type: TypeInfo{ - Name: "NSBackingStoreType", - }, - }, { - Name: "flag", - Type: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - }, - }, - { - name: "instance method with pointer arg and void return", - input: `- (void)removeStatusItem:(NSStatusItem *)item;`, - want: &Statement{ - Method: &MethodDecl{ - NameParts: []string{"removeStatusItem"}, - ReturnType: TypeInfo{ - Name: "void", - }, - Args: []ArgInfo{ - { - Name: "item", - Type: TypeInfo{ - Name: "NSStatusItem", - IsPtr: true, - }, - }, - }, - }, - }, - }, - { - name: "property", - input: `@property CGFloat alphaValue;`, - want: &Statement{ - Property: &PropertyDecl{ - Name: "alphaValue", - Type: TypeInfo{ - Name: "CGFloat", - }, - }, - }, - }, - { - name: "property with getter and read only", - input: `@property(getter=isVisible, readonly) BOOL visible;`, - want: &Statement{ - Property: &PropertyDecl{ - Name: "visible", - Readonly: true, - Getter: "isVisible", - Type: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - { - name: "property on class with strong, read only and pointer type", - input: `@property(class, readonly, strong) NSStatusBar *systemStatusBar;`, - want: &Statement{ - Property: &PropertyDecl{ - Name: "systemStatusBar", - TypeProperty: true, - Readonly: true, - Type: TypeInfo{ - Name: "NSStatusBar", - IsPtr: true, - }, - }, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - buf := bytes.NewBufferString(tt.input) - p := NewParser(buf) - got, err := p.Parse() - if (err != nil) != tt.wantErr { - t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Parse() got = %s, stmt %s", got, tt.want) - } - }) - } -} - -func TestStatement_String(t *testing.T) { - tests := []struct { - name string - input *Statement - want string - }{ - { - name: "interface with super class", - want: `@interface NSMenu : NSObject`, - input: &Statement{ - Interface: &InterfaceDecl{ - Name: "NSMenu", - SuperName: "NSObject", - }, - }, - }, - { - name: "type method", - want: `+ (BOOL)menuBarVisible;`, - input: &Statement{ - Method: &MethodDecl{ - TypeMethod: true, - NameParts: []string{"menuBarVisible"}, - ReturnType: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - { - name: "type method with one arg", - want: `+ (void)setMenuBarVisible:(BOOL)visible;`, - input: &Statement{ - Method: &MethodDecl{ - TypeMethod: true, - ReturnType: TypeInfo{ - Name: "void", - }, - NameParts: []string{"setMenuBarVisible"}, - Args: []ArgInfo{ - { - Name: "visible", - Type: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - }, - }, - { - name: "instance method", - want: `- (NSRect)convertRectToBacking:(NSRect)rect;`, - input: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "NSRect", - }, - NameParts: []string{"convertRectToBacking"}, - Args: []ArgInfo{ - { - Name: "rect", - Type: TypeInfo{ - Name: "NSRect", - }, - }, - }, - }, - }, - }, - { - name: "instance method with pointer return and arg", - want: `- (NSColor *)blendedColorWithFraction:(CGFloat)fraction -ofColor:(NSColor *)color;`, - input: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "NSColor", - IsPtr: true, - }, - NameParts: []string{"blendedColorWithFraction", "ofColor"}, - Args: []ArgInfo{ - { - Name: "fraction", - Type: TypeInfo{ - Name: "CGFloat", - }, - }, - { - Name: "color", - Type: TypeInfo{ - Name: "NSColor", - IsPtr: true, - }, - }, - }, - }, - }, - }, - { - name: "instance method with no arg and void return", - want: `- (void)resetCursorRects;`, - input: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "void", - }, - NameParts: []string{"resetCursorRects"}, - }, - }, - }, - { - name: "instance method with more than one arg", - want: `- (instancetype)initWithContentRect:(NSRect)contentRect -styleMask:(NSWindowStyleMask)style -backing:(NSBackingStoreType)backingStoreType -defer:(BOOL)flag;`, - input: &Statement{ - Method: &MethodDecl{ - ReturnType: TypeInfo{ - Name: "instancetype", - }, - NameParts: []string{"initWithContentRect", "styleMask", "backing", "defer"}, - Args: []ArgInfo{ - { - Name: "contentRect", - Type: TypeInfo{ - Name: "NSRect", - }, - }, { - Name: "style", - Type: TypeInfo{ - Name: "NSWindowStyleMask", - }, - }, { - Name: "backingStoreType", - Type: TypeInfo{ - Name: "NSBackingStoreType", - }, - }, { - Name: "flag", - Type: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - }, - }, - { - name: "instance method with pointer arg and void return", - want: `- (void)removeStatusItem:(NSStatusItem *)item;`, - input: &Statement{ - Method: &MethodDecl{ - NameParts: []string{"removeStatusItem"}, - ReturnType: TypeInfo{ - Name: "void", - }, - Args: []ArgInfo{ - { - Name: "item", - Type: TypeInfo{ - Name: "NSStatusItem", - IsPtr: true, - }, - }, - }, - }, - }, - }, - { - name: "property", - want: `@property CGFloat alphaValue;`, - input: &Statement{ - Property: &PropertyDecl{ - Name: "alphaValue", - Type: TypeInfo{ - Name: "CGFloat", - }, - }, - }, - }, - { - name: "property with getter and read only", - want: `@property(getter=isVisible, readonly) BOOL visible;`, - input: &Statement{ - Property: &PropertyDecl{ - Name: "visible", - Readonly: true, - Getter: "isVisible", - Type: TypeInfo{ - Name: "BOOL", - }, - }, - }, - }, - { - name: "property on class with strong, read only and pointer type", - want: `@property(class, readonly) NSStatusBar *systemStatusBar;`, - input: &Statement{ - Property: &PropertyDecl{ - Name: "systemStatusBar", - TypeProperty: true, - Readonly: true, - Type: TypeInfo{ - Name: "NSStatusBar", - IsPtr: true, - }, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := (*tt.input).String() - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Parse() got = %q, want = %q", got, tt.want) - } - }) - } -} diff --git a/objc/declparser/scanner.go b/objc/declparser/scanner.go deleted file mode 100644 index 3950d0e5..00000000 --- a/objc/declparser/scanner.go +++ /dev/null @@ -1,161 +0,0 @@ -package declparser - -import ( - "bufio" - "bytes" -) - -type token int - -const ( - ILLEGAL token = iota - EOF - WS - IDENT - - LEFTPAREN - RIGHTPAREN - ASTERISK - PLUS - MINUS - SEMICOLON - COLON - COMMA - EQUAL - - INTERFACE - PROPERTY -) - -var eof = rune(0) - -func isWhitespace(ch rune) bool { - return ch == ' ' || ch == '\t' || ch == '\n' -} - -func isLetter(ch rune) bool { - return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') -} - -func isDigit(ch rune) bool { - return ('0' <= ch && ch <= '9') -} - -type scanner struct { - r *bufio.Reader -} - -// read reads the next rune from the bufferred reader. -// Returns the rune(0) if an error occurs (or io.EOF is returned). -func (s *scanner) read() rune { - ch, _, err := s.r.ReadRune() - if err != nil { - return eof - } - return ch -} - -// unread places the previously read rune back on the reader. -func (s *scanner) unread() { _ = s.r.UnreadRune() } - -// Scan returns the next token and literal value. -func (s *scanner) Scan() (tok token, lit string) { - ch := s.read() - - // If we see whitespace then consume all contiguous whitespace. - if isWhitespace(ch) { - s.unread() - return s.scanWhitespace() - } - - // If we see a letter then consume as an ident. - if isLetter(ch) { - s.unread() - return s.scanIdent() - } - - // If we see @ then consume following ident as a keyword. - if ch == '@' { - tok, lit = s.scanIdent() - lit = "@" + lit - switch lit { - case "@property": - return PROPERTY, lit - case "@interface": - return INTERFACE, lit - default: - return ILLEGAL, lit - } - } - - // Otherwise read the individual character. - switch ch { - case eof: - return EOF, "" - case '*': - return ASTERISK, string(ch) - case ',': - return COMMA, string(ch) - case '(': - return LEFTPAREN, string(ch) - case ')': - return RIGHTPAREN, string(ch) - case ':': - return COLON, string(ch) - case ';': - return SEMICOLON, string(ch) - case '+': - return PLUS, string(ch) - case '-': - return MINUS, string(ch) - case '=': - return EQUAL, string(ch) - } - - return ILLEGAL, string(ch) -} - -// scanWhitespace consumes the current rune and all contiguous whitespace. -func (s *scanner) scanWhitespace() (tok token, lit string) { - // Create a buffer and read the current character into it. - var buf bytes.Buffer - buf.WriteRune(s.read()) - - // Read every subsequent whitespace character into the buffer. - // Non-whitespace characters and EOF will cause the loop to exit. - for { - if ch := s.read(); ch == eof { - break - } else if !isWhitespace(ch) { - s.unread() - break - } else { - buf.WriteRune(ch) - } - } - - return WS, buf.String() -} - -// scanIdent consumes the current rune and all contiguous ident runes. -func (s *scanner) scanIdent() (tok token, lit string) { - // Create a buffer and read the current character into it. - var buf bytes.Buffer - buf.WriteRune(s.read()) - - // Read every subsequent ident character into the buffer. - // Non-ident characters and EOF will cause the loop to exit. - for { - if ch := s.read(); ch == eof { - break - } else if !isLetter(ch) && !isDigit(ch) && ch != '_' { - s.unread() - break - } else { - _, _ = buf.WriteRune(ch) - } - } - - // Otherwise return as a regular identifier. - return IDENT, buf.String() -} diff --git a/objc/demo-ios/MainWindow.xib b/objc/demo-ios/MainWindow.xib deleted file mode 100644 index c186b55f..00000000 --- a/objc/demo-ios/MainWindow.xib +++ /dev/null @@ -1,143 +0,0 @@ - - - - 1536 - 12C60 - 2843 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 - - - YES - IBProxyObject - IBUICustomObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - - YES - - - delegate - - - - 4 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - 3 - - - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - GOAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 18 - - - - YES - - GOAppDelegate - NSObject - - IBProjectSource - ./GOAppDelegate.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 1929 - - diff --git a/objc/demo-ios/demo.app/Info.plist b/objc/demo-ios/demo.app/Info.plist deleted file mode 100644 index 1ec4ac4f0f263ce769b3f93fe065e4891b8e9079..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 867 zcmZuu%T5$Q6s;;>AS%T}S~?w7u1a# z<8q>VmhLn$#*c8r(jRci!s?l6e8k$^n{#g6d(OS(IAn<`6n1exL=GLO!ah=p|*@7Gwqw$CbzN*DL!A8i(J?OAFg`&e!y z(Vv&>6}p`=NfWD76`U6BKlWg{~{`@wJS`c??}V?up0&DWQvKzxuf5Q zk;_*mo@9e&Zq%|_%{(T4mTzRZ&f8RH(_~}H#bc}1|F%%l7ng)7&;f3O8L$8/dev/null 2>/dev/null - -${IBTOOL} --errors --warnings --notices --output-format human-readable-text \ - --compile demo.app/MainWindow.nib MainWindow.xib \ - --sdk ${SDK} - -cp demo-ios demo.app/demo diff --git a/schema/NSApplication.json b/schema/NSApplication.json deleted file mode 100644 index d92029cb..00000000 --- a/schema/NSApplication.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "Name": "NSApplication", - "Description": "An object that manages an app’s main event loop and resources used by all of that app’s objects.", - "InstanceMethods": [ - { - "Name": "nextEventMatchingMask:untilDate:inMode:dequeue:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428485-nexteventmatchingmask?language=objc" - }, - { - "Name": "discardEventsMatchingMask:beforeEvent:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428652-discardeventsmatchingmask?language=objc" - }, - { - "Name": "run", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428631-run?language=objc" - }, - { - "Name": "finishLaunching", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428771-finishlaunching?language=objc" - }, - { - "Name": "stop:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428473-stop?language=objc" - }, - { - "Name": "sendEvent:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428359-sendevent?language=objc" - }, - { - "Name": "postEvent:atStart:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428710-postevent?language=objc" - }, - { - "Name": "tryToPerform:with:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428366-trytoperform?language=objc" - }, - { - "Name": "sendAction:to:from:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428509-sendaction?language=objc" - }, - { - "Name": "targetForAction:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428449-targetforaction?language=objc" - }, - { - "Name": "targetForAction:to:from:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428658-targetforaction?language=objc" - }, - { - "Name": "terminate:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428417-terminate?language=objc" - }, - { - "Name": "replyToApplicationShouldTerminate:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428594-replytoapplicationshouldterminat?language=objc" - }, - { - "Name": "activateIgnoringOtherApps:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428468-activateignoringotherapps?language=objc" - }, - { - "Name": "deactivate", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428428-deactivate?language=objc" - }, - { - "Name": "disableRelaunchOnLogin", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428376-disablerelaunchonlogin?language=objc" - }, - { - "Name": "enableRelaunchOnLogin", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428453-enablerelaunchonlogin?language=objc" - }, - { - "Name": "registerForRemoteNotifications", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/2967172-registerforremotenotifications?language=objc" - }, - { - "Name": "unregisterForRemoteNotifications", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc" - }, - { - "Name": "registerForRemoteNotificationTypes:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc" - }, - { - "Name": "toggleTouchBarCustomizationPalette:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/2646920-toggletouchbarcustomizationpalet?language=objc" - }, - { - "Name": "requestUserAttention:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428358-requestuserattention?language=objc" - }, - { - "Name": "cancelUserAttentionRequest:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428683-canceluserattentionrequest?language=objc" - }, - { - "Name": "replyToOpenOrPrint:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428592-replytoopenorprint?language=objc" - }, - { - "Name": "registerUserInterfaceItemSearchHandler:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1420818-registeruserinterfaceitemsearchh?language=objc" - }, - { - "Name": "searchString:inUserInterfaceItemString:searchRange:foundRange:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1420808-searchstring?language=objc" - }, - { - "Name": "unregisterUserInterfaceItemSearchHandler:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1420820-unregisteruserinterfaceitemsearc?language=objc" - }, - { - "Name": "showHelp:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1500910-showhelp?language=objc" - }, - { - "Name": "activateContextHelpMode:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1500925-activatecontexthelpmode?language=objc" - }, - { - "Name": "validRequestorForSendType:returnType:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428379-validrequestorforsendtype?language=objc" - }, - { - "Name": "hideOtherApplications:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428746-hideotherapplications?language=objc" - }, - { - "Name": "unhideAllApplications:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428737-unhideallapplications?language=objc" - }, - { - "Name": "reportException:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428396-reportexception?language=objc" - }, - { - "Name": "activationPolicy", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428703-activationpolicy?language=objc" - }, - { - "Name": "setActivationPolicy:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428621-setactivationpolicy?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "detachDrawingThread:toTarget:withObject:", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428374-detachdrawingthread?language=objc" - } - ], - "Properties": [ - { - "Name": "sharedApplication", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428360-sharedapplication?language=objc" - }, - { - "Name": "delegate", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428705-delegate?language=objc" - }, - { - "Name": "currentEvent", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428668-currentevent?language=objc" - }, - { - "Name": "running", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428759-running?language=objc" - }, - { - "Name": "active", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428493-active?language=objc" - }, - { - "Name": "enabledRemoteNotificationTypes", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428776-enabledremotenotificationtypes?language=objc" - }, - { - "Name": "registeredForRemoteNotifications", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/2967173-registeredforremotenotifications?language=objc" - }, - { - "Name": "appearance", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc" - }, - { - "Name": "effectiveAppearance", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc" - }, - { - "Name": "currentSystemPresentationOptions", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428717-currentsystempresentationoptions?language=objc" - }, - { - "Name": "presentationOptions", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428664-presentationoptions?language=objc" - }, - { - "Name": "userInterfaceLayoutDirection", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428556-userinterfacelayoutdirection?language=objc" - }, - { - "Name": "dockTile", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428671-docktile?language=objc" - }, - { - "Name": "applicationIconImage", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428744-applicationiconimage?language=objc" - }, - { - "Name": "helpMenu", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428644-helpmenu?language=objc" - }, - { - "Name": "servicesProvider", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428467-servicesprovider?language=objc" - }, - { - "Name": "fullKeyboardAccessEnabled", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1428469-fullkeyboardaccessenabled?language=objc" - }, - { - "Name": "orderedDocuments", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1494283-ordereddocuments?language=objc" - }, - { - "Name": "orderedWindows", - "URL": "https://developer.apple.com/documentation/appkit/nsapplication/1494287-orderedwindows?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nsapplication?language=objc" -} diff --git a/schema/NSAutoreleasePool.json b/schema/NSAutoreleasePool.json deleted file mode 100644 index 7e5f8b16..00000000 --- a/schema/NSAutoreleasePool.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Name": "NSAutoreleasePool", - "Description": "An object that supports Cocoa’s reference-counted memory management system.", - "InstanceMethods": [ - { - "Name": "drain", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1520553-drain?language=objc" - }, - { - "Name": "addObject:", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1520555-addobject?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "addObject:", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1520551-addobject?language=objc" - }, - { - "Name": "showPools", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1539124-showpools?language=objc" - } - ], - "Properties": [ - { - "Name": "release", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1807014-release?language=objc" - }, - { - "Name": "autorelease", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1807021-autorelease?language=objc" - }, - { - "Name": "retain", - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool/1807026-retain?language=objc" - } - ], - "Frameworks": [ - "Foundation" - ], - "Platforms": [ - "iOS 2.0+", - "macOS 10.0+", - "Mac Catalyst 13.0+", - "tvOS 9.0+", - "watchOS 2.0+" - ], - "URL": "https://developer.apple.com/documentation/foundation/nsautoreleasepool?language=objc" -} diff --git a/schema/NSColor.json b/schema/NSColor.json deleted file mode 100644 index 5dabf349..00000000 --- a/schema/NSColor.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "Name": "NSColor", - "Description": "An object that stores color data and sometimes opacity (alpha value).", - "InstanceMethods": [ - { - "Name": "colorWithSystemEffect:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/2998826-colorwithsystemeffect?language=objc" - }, - { - "Name": "colorUsingColorSpace:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1527379-colorusingcolorspace?language=objc" - }, - { - "Name": "blendedColorWithFraction:ofColor:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1524689-blendedcolorwithfraction?language=objc" - }, - { - "Name": "colorWithAlphaComponent:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1526906-colorwithalphacomponent?language=objc" - }, - { - "Name": "highlightWithLevel:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1533061-highlightwithlevel?language=objc" - }, - { - "Name": "shadowWithLevel:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1528523-shadowwithlevel?language=objc" - }, - { - "Name": "writeToPasteboard:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1532199-writetopasteboard?language=objc" - }, - { - "Name": "getCyan:magenta:yellow:black:alpha:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1531348-getcyan?language=objc" - }, - { - "Name": "getHue:saturation:brightness:alpha:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1534060-gethue?language=objc" - }, - { - "Name": "getRed:green:blue:alpha:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1527848-getred?language=objc" - }, - { - "Name": "getWhite:alpha:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1532613-getwhite?language=objc" - }, - { - "Name": "getComponents:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1524600-getcomponents?language=objc" - }, - { - "Name": "colorUsingType:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/2880320-colorusingtype?language=objc" - }, - { - "Name": "drawSwatchInRect:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1531770-drawswatchinrect?language=objc" - }, - { - "Name": "set", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1527089-set?language=objc" - }, - { - "Name": "setFill", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1524755-setfill?language=objc" - }, - { - "Name": "setStroke", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1531019-setstroke?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "colorFromPasteboard:", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1535057-colorfrompasteboard?language=objc" - } - ], - "Properties": [ - { - "Name": "ignoresAlpha", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1533565-ignoresalpha?language=objc" - }, - { - "Name": "numberOfComponents", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1531308-numberofcomponents?language=objc" - }, - { - "Name": "alphaComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1532504-alphacomponent?language=objc" - }, - { - "Name": "whiteComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1534051-whitecomponent?language=objc" - }, - { - "Name": "redComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1530483-redcomponent?language=objc" - }, - { - "Name": "greenComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1525935-greencomponent?language=objc" - }, - { - "Name": "blueComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1534229-bluecomponent?language=objc" - }, - { - "Name": "cyanComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1528234-cyancomponent?language=objc" - }, - { - "Name": "magentaComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1535560-magentacomponent?language=objc" - }, - { - "Name": "yellowComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1531965-yellowcomponent?language=objc" - }, - { - "Name": "blackComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1526883-blackcomponent?language=objc" - }, - { - "Name": "hueComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1531780-huecomponent?language=objc" - }, - { - "Name": "saturationComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1526326-saturationcomponent?language=objc" - }, - { - "Name": "brightnessComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1529355-brightnesscomponent?language=objc" - }, - { - "Name": "catalogNameComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1535443-catalognamecomponent?language=objc" - }, - { - "Name": "localizedCatalogNameComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1535351-localizedcatalognamecomponent?language=objc" - }, - { - "Name": "colorNameComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1528278-colornamecomponent?language=objc" - }, - { - "Name": "localizedColorNameComponent", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1527286-localizedcolornamecomponent?language=objc" - }, - { - "Name": "type", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/2880315-type?language=objc" - }, - { - "Name": "colorSpace", - "URL": "https://developer.apple.com/documentation/appkit/nscolor/1526733-colorspace?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nscolor?language=objc" -} diff --git a/schema/NSMenu.json b/schema/NSMenu.json deleted file mode 100644 index 46d87be5..00000000 --- a/schema/NSMenu.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "Name": "NSMenu", - "Description": "An object that manages an app’s menus.", - "InstanceMethods": [ - { - "Name": "initWithTitle:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518144-initwithtitle?language=objc" - }, - { - "Name": "insertItem:atIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518201-insertitem?language=objc" - }, - { - "Name": "insertItemWithTitle:action:keyEquivalent:atIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518146-insertitemwithtitle?language=objc" - }, - { - "Name": "addItem:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518176-additem?language=objc" - }, - { - "Name": "addItemWithTitle:action:keyEquivalent:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518181-additemwithtitle?language=objc" - }, - { - "Name": "removeItem:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518257-removeitem?language=objc" - }, - { - "Name": "removeItemAtIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518207-removeitematindex?language=objc" - }, - { - "Name": "itemChanged:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518154-itemchanged?language=objc" - }, - { - "Name": "removeAllItems", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518234-removeallitems?language=objc" - }, - { - "Name": "itemWithTag:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518223-itemwithtag?language=objc" - }, - { - "Name": "itemWithTitle:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518248-itemwithtitle?language=objc" - }, - { - "Name": "itemAtIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518218-itematindex?language=objc" - }, - { - "Name": "indexOfItem:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518178-indexofitem?language=objc" - }, - { - "Name": "indexOfItemWithTitle:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518237-indexofitemwithtitle?language=objc" - }, - { - "Name": "indexOfItemWithTag:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518164-indexofitemwithtag?language=objc" - }, - { - "Name": "indexOfItemWithTarget:andAction:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518153-indexofitemwithtarget?language=objc" - }, - { - "Name": "indexOfItemWithRepresentedObject:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518175-indexofitemwithrepresentedobject?language=objc" - }, - { - "Name": "indexOfItemWithSubmenu:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518216-indexofitemwithsubmenu?language=objc" - }, - { - "Name": "setSubmenu:forItem:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518194-setsubmenu?language=objc" - }, - { - "Name": "submenuAction:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518179-submenuaction?language=objc" - }, - { - "Name": "update", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518249-update?language=objc" - }, - { - "Name": "performKeyEquivalent:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518198-performkeyequivalent?language=objc" - }, - { - "Name": "performActionForItemAtIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518210-performactionforitematindex?language=objc" - }, - { - "Name": "popUpMenuPositioningItem:atLocation:inView:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518212-popupmenupositioningitem?language=objc" - }, - { - "Name": "cancelTracking", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518150-canceltracking?language=objc" - }, - { - "Name": "cancelTrackingWithoutAnimation", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518244-canceltrackingwithoutanimation?language=objc" - }, - { - "Name": "initWithCoder:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1644714-initwithcoder?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "menuBarVisible", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518236-menubarvisible?language=objc" - }, - { - "Name": "setMenuBarVisible:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518200-setmenubarvisible?language=objc" - }, - { - "Name": "popUpContextMenu:withEvent:forView:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518170-popupcontextmenu?language=objc" - }, - { - "Name": "popUpContextMenu:withEvent:forView:withFont:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518165-popupcontextmenu?language=objc" - } - ], - "Properties": [ - { - "Name": "menuBarHeight", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518141-menubarheight?language=objc" - }, - { - "Name": "numberOfItems", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518202-numberofitems?language=objc" - }, - { - "Name": "itemArray", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518186-itemarray?language=objc" - }, - { - "Name": "supermenu", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518204-supermenu?language=objc" - }, - { - "Name": "autoenablesItems", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518227-autoenablesitems?language=objc" - }, - { - "Name": "font", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518230-font?language=objc" - }, - { - "Name": "title", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518192-title?language=objc" - }, - { - "Name": "minimumWidth", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518221-minimumwidth?language=objc" - }, - { - "Name": "size", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518185-size?language=objc" - }, - { - "Name": "propertiesToUpdate", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518245-propertiestoupdate?language=objc" - }, - { - "Name": "allowsContextMenuPlugIns", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518220-allowscontextmenuplugins?language=objc" - }, - { - "Name": "showsStateColumn", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518253-showsstatecolumn?language=objc" - }, - { - "Name": "highlightedItem", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518222-highlighteditem?language=objc" - }, - { - "Name": "userInterfaceLayoutDirection", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518254-userinterfacelayoutdirection?language=objc" - }, - { - "Name": "delegate", - "URL": "https://developer.apple.com/documentation/appkit/nsmenu/1518169-delegate?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nsmenu?language=objc" -} diff --git a/schema/NSMenuItem.json b/schema/NSMenuItem.json deleted file mode 100644 index 2f5eea6c..00000000 --- a/schema/NSMenuItem.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "Name": "NSMenuItem", - "Description": "A command item in an app menu.", - "InstanceMethods": [ - { - "Name": "initWithTitle:action:keyEquivalent:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514858-initwithtitle?language=objc" - }, - { - "Name": "initWithCoder:", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1644728-initwithcoder?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "separatorItem", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514838-separatoritem?language=objc" - } - ], - "Properties": [ - { - "Name": "enabled", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514863-enabled?language=objc" - }, - { - "Name": "hidden", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514846-hidden?language=objc" - }, - { - "Name": "hiddenOrHasHiddenAncestor", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514832-hiddenorhashiddenancestor?language=objc" - }, - { - "Name": "target", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514843-target?language=objc" - }, - { - "Name": "action", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514825-action?language=objc" - }, - { - "Name": "title", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514805-title?language=objc" - }, - { - "Name": "attributedTitle", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514860-attributedtitle?language=objc" - }, - { - "Name": "tag", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514840-tag?language=objc" - }, - { - "Name": "state", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514804-state?language=objc" - }, - { - "Name": "image", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514819-image?language=objc" - }, - { - "Name": "onStateImage", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514861-onstateimage?language=objc" - }, - { - "Name": "offStateImage", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514821-offstateimage?language=objc" - }, - { - "Name": "mixedStateImage", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514827-mixedstateimage?language=objc" - }, - { - "Name": "submenu", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514845-submenu?language=objc" - }, - { - "Name": "hasSubmenu", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514817-hassubmenu?language=objc" - }, - { - "Name": "parentItem", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514813-parentitem?language=objc" - }, - { - "Name": "separatorItem", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514837-separatoritem?language=objc" - }, - { - "Name": "menu", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514830-menu?language=objc" - }, - { - "Name": "keyEquivalent", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514842-keyequivalent?language=objc" - }, - { - "Name": "keyEquivalentModifierMask", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514815-keyequivalentmodifiermask?language=objc" - }, - { - "Name": "usesUserKeyEquivalents", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514811-usesuserkeyequivalents?language=objc" - }, - { - "Name": "userKeyEquivalent", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514850-userkeyequivalent?language=objc" - }, - { - "Name": "alternate", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514823-alternate?language=objc" - }, - { - "Name": "indentationLevel", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514809-indentationlevel?language=objc" - }, - { - "Name": "toolTip", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514848-tooltip?language=objc" - }, - { - "Name": "representedObject", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514834-representedobject?language=objc" - }, - { - "Name": "view", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514835-view?language=objc" - }, - { - "Name": "highlighted", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/1514856-highlighted?language=objc" - }, - { - "Name": "allowsKeyEquivalentWhenHidden", - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem/2880316-allowskeyequivalentwhenhidden?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nsmenuitem?language=objc" -} diff --git a/schema/NSScreen.json b/schema/NSScreen.json deleted file mode 100644 index a8613a53..00000000 --- a/schema/NSScreen.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "Name": "NSScreen", - "Description": "An object that describes the attributes of a computer’s monitor or screen.", - "InstanceMethods": [ - { - "Name": "canRepresentDisplayGamut:", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/2138325-canrepresentdisplaygamut?language=objc" - }, - { - "Name": "backingAlignedRect:options:", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388381-backingalignedrect?language=objc" - }, - { - "Name": "convertRectFromBacking:", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388364-convertrectfrombacking?language=objc" - }, - { - "Name": "convertRectToBacking:", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388389-convertrecttobacking?language=objc" - } - ], - "TypeMethods": null, - "Properties": [ - { - "Name": "mainScreen", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388371-mainscreen?language=objc" - }, - { - "Name": "deepestScreen", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388374-deepestscreen?language=objc" - }, - { - "Name": "screens", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388393-screens?language=objc" - }, - { - "Name": "depth", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388373-depth?language=objc" - }, - { - "Name": "frame", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388387-frame?language=objc" - }, - { - "Name": "supportedWindowDepths", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388391-supportedwindowdepths?language=objc" - }, - { - "Name": "deviceDescription", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388360-devicedescription?language=objc" - }, - { - "Name": "visibleFrame", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388369-visibleframe?language=objc" - }, - { - "Name": "colorSpace", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388383-colorspace?language=objc" - }, - { - "Name": "screensHaveSeparateSpaces", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388365-screenshaveseparatespaces?language=objc" - }, - { - "Name": "backingScaleFactor", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388385-backingscalefactor?language=objc" - }, - { - "Name": "maximumPotentialExtendedDynamicRangeColorComponentValue", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/3180381-maximumpotentialextendeddynamicr?language=objc" - }, - { - "Name": "maximumExtendedDynamicRangeColorComponentValue", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/1388362-maximumextendeddynamicrangecolor?language=objc" - }, - { - "Name": "maximumReferenceExtendedDynamicRangeColorComponentValue", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/3180382-maximumreferenceextendeddynamicr?language=objc" - }, - { - "Name": "localizedName", - "URL": "https://developer.apple.com/documentation/appkit/nsscreen/3228043-localizedname?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nsscreen?language=objc" -} diff --git a/schema/NSStatusBar.json b/schema/NSStatusBar.json deleted file mode 100644 index d8a776be..00000000 --- a/schema/NSStatusBar.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Name": "NSStatusBar", - "Description": "An object that manages a collection of status items displayed within the system-wide menu bar.", - "InstanceMethods": [ - { - "Name": "statusItemWithLength:", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusbar/1532895-statusitemwithlength?language=objc" - }, - { - "Name": "removeStatusItem:", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusbar/1530377-removestatusitem?language=objc" - } - ], - "TypeMethods": null, - "Properties": [ - { - "Name": "systemStatusBar", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusbar/1530619-systemstatusbar?language=objc" - }, - { - "Name": "vertical", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusbar/1530580-vertical?language=objc" - }, - { - "Name": "thickness", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusbar/1534591-thickness?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nsstatusbar?language=objc" -} diff --git a/schema/NSStatusItem.json b/schema/NSStatusItem.json deleted file mode 100644 index a6c9a672..00000000 --- a/schema/NSStatusItem.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Name": "NSStatusItem", - "Description": "An individual element displayed in the system menu bar.", - "InstanceMethods": null, - "TypeMethods": null, - "Properties": [ - { - "Name": "statusBar", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1525951-statusbar?language=objc" - }, - { - "Name": "behavior", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1644024-behavior?language=objc" - }, - { - "Name": "button", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1535056-button?language=objc" - }, - { - "Name": "menu", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1535918-menu?language=objc" - }, - { - "Name": "visible", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1644025-visible?language=objc" - }, - { - "Name": "length", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1529402-length?language=objc" - }, - { - "Name": "autosaveName", - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem/1644022-autosavename?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nsstatusitem?language=objc" -} diff --git a/schema/NSWindow.json b/schema/NSWindow.json deleted file mode 100644 index 64546b6c..00000000 --- a/schema/NSWindow.json +++ /dev/null @@ -1,997 +0,0 @@ -{ - "Name": "NSWindow", - "Description": "A window that an app displays on the screen.", - "InstanceMethods": [ - { - "Name": "initWithContentRect:styleMask:backing:defer:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419477-initwithcontentrect?language=objc" - }, - { - "Name": "initWithContentRect:styleMask:backing:defer:screen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419755-initwithcontentrect?language=objc" - }, - { - "Name": "toggleFullScreen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419527-togglefullscreen?language=objc" - }, - { - "Name": "invalidateShadow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419529-invalidateshadow?language=objc" - }, - { - "Name": "autorecalculatesContentBorderThicknessForEdge:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419356-autorecalculatescontentborderthi?language=objc" - }, - { - "Name": "setAutorecalculatesContentBorderThickness:forEdge:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419218-setautorecalculatescontentborder?language=objc" - }, - { - "Name": "contentBorderThicknessForEdge:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419775-contentborderthicknessforedge?language=objc" - }, - { - "Name": "setContentBorderThickness:forEdge:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419541-setcontentborderthickness?language=objc" - }, - { - "Name": "contentRectForFrameRect:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419108-contentrectforframerect?language=objc" - }, - { - "Name": "frameRectForContentRect:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419134-framerectforcontentrect?language=objc" - }, - { - "Name": "beginSheet:completionHandler:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419653-beginsheet?language=objc" - }, - { - "Name": "beginCriticalSheet:completionHandler:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419198-begincriticalsheet?language=objc" - }, - { - "Name": "endSheet:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419318-endsheet?language=objc" - }, - { - "Name": "endSheet:returnCode:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419497-endsheet?language=objc" - }, - { - "Name": "setFrameOrigin:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419690-setframeorigin?language=objc" - }, - { - "Name": "setFrameTopLeftPoint:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419658-setframetopleftpoint?language=objc" - }, - { - "Name": "constrainFrameRect:toScreen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419779-constrainframerect?language=objc" - }, - { - "Name": "cascadeTopLeftFromPoint:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419392-cascadetopleftfrompoint?language=objc" - }, - { - "Name": "setFrame:display:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419753-setframe?language=objc" - }, - { - "Name": "setFrame:display:animate:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419519-setframe?language=objc" - }, - { - "Name": "animationResizeTime:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419655-animationresizetime?language=objc" - }, - { - "Name": "performZoom:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419450-performzoom?language=objc" - }, - { - "Name": "zoom:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419513-zoom?language=objc" - }, - { - "Name": "setContentSize:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419100-setcontentsize?language=objc" - }, - { - "Name": "orderOut:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419660-orderout?language=objc" - }, - { - "Name": "orderBack:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419204-orderback?language=objc" - }, - { - "Name": "orderFront:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419495-orderfront?language=objc" - }, - { - "Name": "orderFrontRegardless", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419444-orderfrontregardless?language=objc" - }, - { - "Name": "orderWindow:relativeTo:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419672-orderwindow?language=objc" - }, - { - "Name": "setFrameUsingName:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419723-setframeusingname?language=objc" - }, - { - "Name": "setFrameUsingName:force:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419226-setframeusingname?language=objc" - }, - { - "Name": "saveFrameUsingName:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419290-saveframeusingname?language=objc" - }, - { - "Name": "setFrameFromString:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419759-setframefromstring?language=objc" - }, - { - "Name": "makeKeyWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419368-makekeywindow?language=objc" - }, - { - "Name": "makeKeyAndOrderFront:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419208-makekeyandorderfront?language=objc" - }, - { - "Name": "becomeKeyWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419338-becomekeywindow?language=objc" - }, - { - "Name": "resignKeyWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419047-resignkeywindow?language=objc" - }, - { - "Name": "makeMainWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419271-makemainwindow?language=objc" - }, - { - "Name": "becomeMainWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419084-becomemainwindow?language=objc" - }, - { - "Name": "resignMainWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419212-resignmainwindow?language=objc" - }, - { - "Name": "toggleToolbarShown:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419554-toggletoolbarshown?language=objc" - }, - { - "Name": "runToolbarCustomizationPalette:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419284-runtoolbarcustomizationpalette?language=objc" - }, - { - "Name": "addChildWindow:ordered:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419152-addchildwindow?language=objc" - }, - { - "Name": "removeChildWindow:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419063-removechildwindow?language=objc" - }, - { - "Name": "enableKeyEquivalentForDefaultButtonCell", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419276-enablekeyequivalentfordefaultbut?language=objc" - }, - { - "Name": "disableKeyEquivalentForDefaultButtonCell", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419242-disablekeyequivalentfordefaultbu?language=objc" - }, - { - "Name": "fieldEditor:forObject:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419647-fieldeditor?language=objc" - }, - { - "Name": "endEditingFor:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419469-endeditingfor?language=objc" - }, - { - "Name": "enableCursorRects", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419202-enablecursorrects?language=objc" - }, - { - "Name": "disableCursorRects", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419639-disablecursorrects?language=objc" - }, - { - "Name": "discardCursorRects", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419269-discardcursorrects?language=objc" - }, - { - "Name": "invalidateCursorRectsForView:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419601-invalidatecursorrectsforview?language=objc" - }, - { - "Name": "resetCursorRects", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419464-resetcursorrects?language=objc" - }, - { - "Name": "standardWindowButton:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419491-standardwindowbutton?language=objc" - }, - { - "Name": "addTitlebarAccessoryViewController:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419382-addtitlebaraccessoryviewcontroll?language=objc" - }, - { - "Name": "insertTitlebarAccessoryViewController:atIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419275-inserttitlebaraccessoryviewcontr?language=objc" - }, - { - "Name": "removeTitlebarAccessoryViewControllerAtIndex:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419643-removetitlebaraccessoryviewcontr?language=objc" - }, - { - "Name": "addTabbedWindow:ordered:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1855947-addtabbedwindow?language=objc" - }, - { - "Name": "selectNextTab:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644693-selectnexttab?language=objc" - }, - { - "Name": "selectPreviousTab:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644555-selectprevioustab?language=objc" - }, - { - "Name": "moveTabToNewWindow:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644410-movetabtonewwindow?language=objc" - }, - { - "Name": "toggleTabBar:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644517-toggletabbar?language=objc" - }, - { - "Name": "toggleTabOverview:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2870175-toggletaboverview?language=objc" - }, - { - "Name": "nextEventMatchingMask:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419304-nexteventmatchingmask?language=objc" - }, - { - "Name": "nextEventMatchingMask:untilDate:inMode:dequeue:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419721-nexteventmatchingmask?language=objc" - }, - { - "Name": "discardEventsMatchingMask:beforeEvent:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419676-discardeventsmatchingmask?language=objc" - }, - { - "Name": "postEvent:atStart:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419376-postevent?language=objc" - }, - { - "Name": "sendEvent:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419228-sendevent?language=objc" - }, - { - "Name": "tryToPerform:with:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419428-trytoperform?language=objc" - }, - { - "Name": "makeFirstResponder:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419366-makefirstresponder?language=objc" - }, - { - "Name": "selectKeyViewPrecedingView:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419757-selectkeyviewprecedingview?language=objc" - }, - { - "Name": "selectKeyViewFollowingView:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419633-selectkeyviewfollowingview?language=objc" - }, - { - "Name": "selectPreviousKeyView:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419110-selectpreviouskeyview?language=objc" - }, - { - "Name": "selectNextKeyView:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419715-selectnextkeyview?language=objc" - }, - { - "Name": "recalculateKeyViewLoop", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419350-recalculatekeyviewloop?language=objc" - }, - { - "Name": "keyDown:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419200-keydown?language=objc" - }, - { - "Name": "trackEventsMatchingMask:timeout:mode:handler:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419727-trackeventsmatchingmask?language=objc" - }, - { - "Name": "performWindowDragWithEvent:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419386-performwindowdragwithevent?language=objc" - }, - { - "Name": "disableSnapshotRestoration", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526239-disablesnapshotrestoration?language=objc" - }, - { - "Name": "enableSnapshotRestoration", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1525288-enablesnapshotrestoration?language=objc" - }, - { - "Name": "display", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419358-display?language=objc" - }, - { - "Name": "displayIfNeeded", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419096-displayifneeded?language=objc" - }, - { - "Name": "disableScreenUpdatesUntilFlush", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419483-disablescreenupdatesuntilflush?language=objc" - }, - { - "Name": "update", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419577-update?language=objc" - }, - { - "Name": "dragImage:at:offset:event:pasteboard:source:slideBack:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419224-dragimage?language=objc" - }, - { - "Name": "registerForDraggedTypes:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419140-registerfordraggedtypes?language=objc" - }, - { - "Name": "unregisterDraggedTypes", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419456-unregisterdraggedtypes?language=objc" - }, - { - "Name": "backingAlignedRect:options:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419319-backingalignedrect?language=objc" - }, - { - "Name": "convertRectFromBacking:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419273-convertrectfrombacking?language=objc" - }, - { - "Name": "convertRectToBacking:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419260-convertrecttobacking?language=objc" - }, - { - "Name": "convertRectToScreen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419286-convertrecttoscreen?language=objc" - }, - { - "Name": "convertRectFromScreen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419603-convertrectfromscreen?language=objc" - }, - { - "Name": "setTitleWithRepresentedFilename:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419192-settitlewithrepresentedfilename?language=objc" - }, - { - "Name": "center", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419090-center?language=objc" - }, - { - "Name": "performClose:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419288-performclose?language=objc" - }, - { - "Name": "close", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419662-close?language=objc" - }, - { - "Name": "performMiniaturize:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419749-performminiaturize?language=objc" - }, - { - "Name": "miniaturize:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419426-miniaturize?language=objc" - }, - { - "Name": "deminiaturize:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419334-deminiaturize?language=objc" - }, - { - "Name": "print:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419767-print?language=objc" - }, - { - "Name": "dataWithEPSInsideRect:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419128-datawithepsinsiderect?language=objc" - }, - { - "Name": "dataWithPDFInsideRect:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419418-datawithpdfinsiderect?language=objc" - }, - { - "Name": "validRequestorForSendType:returnType:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419454-validrequestorforsendtype?language=objc" - }, - { - "Name": "updateConstraintsIfNeeded", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526915-updateconstraintsifneeded?language=objc" - }, - { - "Name": "layoutIfNeeded", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526910-layoutifneeded?language=objc" - }, - { - "Name": "visualizeConstraints:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526997-visualizeconstraints?language=objc" - }, - { - "Name": "anchorAttributeForOrientation:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526957-anchorattributefororientation?language=objc" - }, - { - "Name": "setAnchorAttribute:forOrientation:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526985-setanchorattribute?language=objc" - }, - { - "Name": "initWithWindowRef:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419446-initwithwindowref?language=objc" - }, - { - "Name": "setIsMiniaturized:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449566-setisminiaturized?language=objc" - }, - { - "Name": "setIsVisible:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449570-setisvisible?language=objc" - }, - { - "Name": "setIsZoomed:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449589-setiszoomed?language=objc" - }, - { - "Name": "handleCloseScriptCommand:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449581-handleclosescriptcommand?language=objc" - }, - { - "Name": "handlePrintScriptCommand:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449585-handleprintscriptcommand?language=objc" - }, - { - "Name": "handleSaveScriptCommand:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449591-handlesavescriptcommand?language=objc" - }, - { - "Name": "canRepresentDisplayGamut:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2138278-canrepresentdisplaygamut?language=objc" - }, - { - "Name": "convertPointFromScreen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2967180-convertpointfromscreen?language=objc" - }, - { - "Name": "convertPointToScreen:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2967182-convertpointtoscreen?language=objc" - }, - { - "Name": "convertPointFromBacking:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2967179-convertpointfrombacking?language=objc" - }, - { - "Name": "convertPointToBacking:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2967181-convertpointtobacking?language=objc" - }, - { - "Name": "mergeAllWindows:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644639-mergeallwindows?language=objc" - }, - { - "Name": "setDynamicDepthLimit:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419473-setdynamicdepthlimit?language=objc" - }, - { - "Name": "setFrameAutosaveName:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419509-setframeautosavename?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "windowWithContentViewController:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419551-windowwithcontentviewcontroller?language=objc" - }, - { - "Name": "windowNumbersWithOptions:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419678-windownumberswithoptions?language=objc" - }, - { - "Name": "contentRectForFrameRect:styleMask:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419586-contentrectforframerect?language=objc" - }, - { - "Name": "frameRectForContentRect:styleMask:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419372-framerectforcontentrect?language=objc" - }, - { - "Name": "minFrameWidthWithTitle:styleMask:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419294-minframewidthwithtitle?language=objc" - }, - { - "Name": "removeFrameUsingName:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419313-removeframeusingname?language=objc" - }, - { - "Name": "standardWindowButton:forStyleMask:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419173-standardwindowbutton?language=objc" - }, - { - "Name": "windowNumberAtPoint:belowWindowWithWindowNumber:", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419210-windownumberatpoint?language=objc" - } - ], - "Properties": [ - { - "Name": "delegate", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419060-delegate?language=objc" - }, - { - "Name": "contentViewController", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419615-contentviewcontroller?language=objc" - }, - { - "Name": "contentView", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419160-contentview?language=objc" - }, - { - "Name": "worksWhenModal", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419220-workswhenmodal?language=objc" - }, - { - "Name": "alphaValue", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419186-alphavalue?language=objc" - }, - { - "Name": "backgroundColor", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419751-backgroundcolor?language=objc" - }, - { - "Name": "colorSpace", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419569-colorspace?language=objc" - }, - { - "Name": "canHide", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419725-canhide?language=objc" - }, - { - "Name": "onActiveSpace", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419707-onactivespace?language=objc" - }, - { - "Name": "hidesOnDeactivate", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419777-hidesondeactivate?language=objc" - }, - { - "Name": "collectionBehavior", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419471-collectionbehavior?language=objc" - }, - { - "Name": "opaque", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419086-opaque?language=objc" - }, - { - "Name": "hasShadow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419234-hasshadow?language=objc" - }, - { - "Name": "preventsApplicationTerminationWhenModal", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419743-preventsapplicationterminationwh?language=objc" - }, - { - "Name": "defaultDepthLimit", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419049-defaultdepthlimit?language=objc" - }, - { - "Name": "windowNumber", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419068-windownumber?language=objc" - }, - { - "Name": "deviceDescription", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419741-devicedescription?language=objc" - }, - { - "Name": "canBecomeVisibleWithoutLogin", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419179-canbecomevisiblewithoutlogin?language=objc" - }, - { - "Name": "sharingType", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419729-sharingtype?language=objc" - }, - { - "Name": "backingType", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419599-backingtype?language=objc" - }, - { - "Name": "depthLimit", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419613-depthlimit?language=objc" - }, - { - "Name": "hasDynamicDepthLimit", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419330-hasdynamicdepthlimit?language=objc" - }, - { - "Name": "windowController", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419092-windowcontroller?language=objc" - }, - { - "Name": "attachedSheet", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419467-attachedsheet?language=objc" - }, - { - "Name": "sheet", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419364-sheet?language=objc" - }, - { - "Name": "sheetParent", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419052-sheetparent?language=objc" - }, - { - "Name": "sheets", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419765-sheets?language=objc" - }, - { - "Name": "frame", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419697-frame?language=objc" - }, - { - "Name": "aspectRatio", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419507-aspectratio?language=objc" - }, - { - "Name": "minSize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419206-minsize?language=objc" - }, - { - "Name": "maxSize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419595-maxsize?language=objc" - }, - { - "Name": "zoomed", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419398-zoomed?language=objc" - }, - { - "Name": "resizeFlags", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419302-resizeflags?language=objc" - }, - { - "Name": "resizeIncrements", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419390-resizeincrements?language=objc" - }, - { - "Name": "preservesContentDuringLiveResize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419588-preservescontentduringliveresize?language=objc" - }, - { - "Name": "inLiveResize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419378-inliveresize?language=objc" - }, - { - "Name": "contentAspectRatio", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419148-contentaspectratio?language=objc" - }, - { - "Name": "contentMinSize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419670-contentminsize?language=objc" - }, - { - "Name": "contentMaxSize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419154-contentmaxsize?language=objc" - }, - { - "Name": "contentResizeIncrements", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419649-contentresizeincrements?language=objc" - }, - { - "Name": "contentLayoutGuide", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419094-contentlayoutguide?language=objc" - }, - { - "Name": "contentLayoutRect", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419124-contentlayoutrect?language=objc" - }, - { - "Name": "maxFullScreenContentSize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419438-maxfullscreencontentsize?language=objc" - }, - { - "Name": "minFullScreenContentSize", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419627-minfullscreencontentsize?language=objc" - }, - { - "Name": "level", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419511-level?language=objc" - }, - { - "Name": "visible", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419132-visible?language=objc" - }, - { - "Name": "occlusionState", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419321-occlusionstate?language=objc" - }, - { - "Name": "frameAutosaveName", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419362-frameautosavename?language=objc" - }, - { - "Name": "stringWithSavedFrame", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419515-stringwithsavedframe?language=objc" - }, - { - "Name": "keyWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419735-keywindow?language=objc" - }, - { - "Name": "canBecomeKeyWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419543-canbecomekeywindow?language=objc" - }, - { - "Name": "mainWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419130-mainwindow?language=objc" - }, - { - "Name": "canBecomeMainWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419162-canbecomemainwindow?language=objc" - }, - { - "Name": "toolbar", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419731-toolbar?language=objc" - }, - { - "Name": "childWindows", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419236-childwindows?language=objc" - }, - { - "Name": "parentWindow", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419695-parentwindow?language=objc" - }, - { - "Name": "defaultButtonCell", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419328-defaultbuttoncell?language=objc" - }, - { - "Name": "excludedFromWindowsMenu", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419175-excludedfromwindowsmenu?language=objc" - }, - { - "Name": "areCursorRectsEnabled", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419668-arecursorrectsenabled?language=objc" - }, - { - "Name": "showsToolbarButton", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419196-showstoolbarbutton?language=objc" - }, - { - "Name": "titlebarAppearsTransparent", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc" - }, - { - "Name": "toolbarStyle", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/3608199-toolbarstyle?language=objc" - }, - { - "Name": "titlebarSeparatorStyle", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/3622489-titlebarseparatorstyle?language=objc" - }, - { - "Name": "titlebarAccessoryViewControllers", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419547-titlebaraccessoryviewcontrollers?language=objc" - }, - { - "Name": "allowsAutomaticWindowTabbing", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1646657-allowsautomaticwindowtabbing?language=objc" - }, - { - "Name": "userTabbingPreference", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1646658-usertabbingpreference?language=objc" - }, - { - "Name": "tab", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2870102-tab?language=objc" - }, - { - "Name": "tabbingIdentifier", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier?language=objc" - }, - { - "Name": "tabbingMode", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644729-tabbingmode?language=objc" - }, - { - "Name": "tabbedWindows", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1792044-tabbedwindows?language=objc" - }, - { - "Name": "tabGroup", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2879189-tabgroup?language=objc" - }, - { - "Name": "allowsToolTipsWhenApplicationIsInactive", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419138-allowstooltipswhenapplicationisi?language=objc" - }, - { - "Name": "currentEvent", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419298-currentevent?language=objc" - }, - { - "Name": "initialFirstResponder", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419479-initialfirstresponder?language=objc" - }, - { - "Name": "firstResponder", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419440-firstresponder?language=objc" - }, - { - "Name": "keyViewSelectionDirection", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419158-keyviewselectiondirection?language=objc" - }, - { - "Name": "autorecalculatesKeyViewLoop", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419214-autorecalculateskeyviewloop?language=objc" - }, - { - "Name": "acceptsMouseMovedEvents", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419340-acceptsmousemovedevents?language=objc" - }, - { - "Name": "ignoresMouseEvents", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419354-ignoresmouseevents?language=objc" - }, - { - "Name": "mouseLocationOutsideOfEventStream", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419280-mouselocationoutsideofeventstrea?language=objc" - }, - { - "Name": "restorable", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526255-restorable?language=objc" - }, - { - "Name": "restorationClass", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1526241-restorationclass?language=objc" - }, - { - "Name": "viewsNeedDisplay", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419609-viewsneeddisplay?language=objc" - }, - { - "Name": "allowsConcurrentViewDrawing", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419300-allowsconcurrentviewdrawing?language=objc" - }, - { - "Name": "animationBehavior", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419763-animationbehavior?language=objc" - }, - { - "Name": "documentEdited", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419311-documentedited?language=objc" - }, - { - "Name": "backingScaleFactor", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419459-backingscalefactor?language=objc" - }, - { - "Name": "title", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419404-title?language=objc" - }, - { - "Name": "subtitle", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/3608198-subtitle?language=objc" - }, - { - "Name": "titleVisibility", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419635-titlevisibility?language=objc" - }, - { - "Name": "representedFilename", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419631-representedfilename?language=objc" - }, - { - "Name": "representedURL", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419066-representedurl?language=objc" - }, - { - "Name": "screen", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419232-screen?language=objc" - }, - { - "Name": "deepestScreen", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419080-deepestscreen?language=objc" - }, - { - "Name": "displaysWhenScreenProfileChanges", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419430-displayswhenscreenprofilechanges?language=objc" - }, - { - "Name": "movableByWindowBackground", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419072-movablebywindowbackground?language=objc" - }, - { - "Name": "movable", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419579-movable?language=objc" - }, - { - "Name": "releasedWhenClosed", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419062-releasedwhenclosed?language=objc" - }, - { - "Name": "miniaturized", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419699-miniaturized?language=objc" - }, - { - "Name": "miniwindowImage", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419185-miniwindowimage?language=objc" - }, - { - "Name": "miniwindowTitle", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419571-miniwindowtitle?language=objc" - }, - { - "Name": "dockTile", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419088-docktile?language=objc" - }, - { - "Name": "windowRef", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419485-windowref?language=objc" - }, - { - "Name": "hasCloseBox", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449574-hasclosebox?language=objc" - }, - { - "Name": "hasTitleBar", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449568-hastitlebar?language=objc" - }, - { - "Name": "orderedIndex", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449577-orderedindex?language=objc" - }, - { - "Name": "appearanceSource", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/2998855-appearancesource?language=objc" - }, - { - "Name": "floatingPanel", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449579-floatingpanel?language=objc" - }, - { - "Name": "miniaturizable", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449583-miniaturizable?language=objc" - }, - { - "Name": "modalPanel", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449576-modalpanel?language=objc" - }, - { - "Name": "resizable", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449572-resizable?language=objc" - }, - { - "Name": "styleMask", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1419078-stylemask?language=objc" - }, - { - "Name": "windowTitlebarLayoutDirection", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1644535-windowtitlebarlayoutdirection?language=objc" - }, - { - "Name": "zoomable", - "URL": "https://developer.apple.com/documentation/appkit/nswindow/1449587-zoomable?language=objc" - } - ], - "Frameworks": [ - "AppKit" - ], - "Platforms": [ - "macOS 10.0+" - ], - "URL": "https://developer.apple.com/documentation/appkit/nswindow?language=objc" -} diff --git a/schema/WKWebView.json b/schema/WKWebView.json deleted file mode 100644 index 4baa0b5d..00000000 --- a/schema/WKWebView.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "Name": "WKWebView", - "Description": "An object that displays interactive web content, such as for an in-app browser.", - "InstanceMethods": [ - { - "Name": "initWithFrame:configuration:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414998-initwithframe?language=objc" - }, - { - "Name": "initWithCoder:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1641916-initwithcoder?language=objc" - }, - { - "Name": "loadRequest:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414954-loadrequest?language=objc" - }, - { - "Name": "loadHTMLString:baseURL:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415004-loadhtmlstring?language=objc" - }, - { - "Name": "loadFileURL:allowingReadAccessToURL:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414973-loadfileurl?language=objc" - }, - { - "Name": "loadData:MIMEType:characterEncodingName:baseURL:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415011-loaddata?language=objc" - }, - { - "Name": "reload", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414969-reload?language=objc" - }, - { - "Name": "reload:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414987-reload?language=objc" - }, - { - "Name": "reloadFromOrigin", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414956-reloadfromorigin?language=objc" - }, - { - "Name": "reloadFromOrigin:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414989-reloadfromorigin?language=objc" - }, - { - "Name": "stopLoading", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414981-stoploading?language=objc" - }, - { - "Name": "stopLoading:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415013-stoploading?language=objc" - }, - { - "Name": "setMagnification:centeredAtPoint:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414996-setmagnification?language=objc" - }, - { - "Name": "findString:withConfiguration:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3516409-findstring?language=objc" - }, - { - "Name": "goBack:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414975-goback?language=objc" - }, - { - "Name": "goBack", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414952-goback?language=objc" - }, - { - "Name": "goForward:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414960-goforward?language=objc" - }, - { - "Name": "goForward", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414993-goforward?language=objc" - }, - { - "Name": "goToBackForwardListItem:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414991-gotobackforwardlistitem?language=objc" - }, - { - "Name": "evaluateJavaScript:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415017-evaluatejavascript?language=objc" - }, - { - "Name": "evaluateJavaScript:inFrame:inContentWorld:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3656356-evaluatejavascript?language=objc" - }, - { - "Name": "callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3656355-callasyncjavascript?language=objc" - }, - { - "Name": "takeSnapshotWithConfiguration:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/2873260-takesnapshotwithconfiguration?language=objc" - }, - { - "Name": "createPDFWithConfiguration:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3516407-createpdfwithconfiguration?language=objc" - }, - { - "Name": "createWebArchiveDataWithCompletionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3516408-createwebarchivedatawithcompleti?language=objc" - }, - { - "Name": "printOperationWithPrintInfo:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3516861-printoperationwithprintinfo?language=objc" - }, - { - "Name": "closeAllMediaPresentations", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727363-closeallmediapresentations?language=objc" - }, - { - "Name": "pauseAllMediaPlayback:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727364-pauseallmediaplayback?language=objc" - }, - { - "Name": "requestMediaPlaybackState:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727365-requestmediaplaybackstate?language=objc" - }, - { - "Name": "resumeAllMediaPlayback:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727366-resumeallmediaplayback?language=objc" - }, - { - "Name": "resumeDownloadFromResumeData:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727367-resumedownloadfromresumedata?language=objc" - }, - { - "Name": "startDownloadUsingRequest:completionHandler:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727368-startdownloadusingrequest?language=objc" - }, - { - "Name": "suspendAllMediaPlayback:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3727369-suspendallmediaplayback?language=objc" - } - ], - "TypeMethods": [ - { - "Name": "handlesURLScheme:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/2875370-handlesurlscheme?language=objc" - } - ], - "Properties": [ - { - "Name": "configuration", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414979-configuration?language=objc" - }, - { - "Name": "navigationDelegate", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414971-navigationdelegate?language=objc" - }, - { - "Name": "loading", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414964-loading?language=objc" - }, - { - "Name": "estimatedProgress", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415007-estimatedprogress?language=objc" - }, - { - "Name": "scrollView", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1614784-scrollview?language=objc" - }, - { - "Name": "title", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415015-title?language=objc" - }, - { - "Name": "URL", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415005-url?language=objc" - }, - { - "Name": "mediaType", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3516410-mediatype?language=objc" - }, - { - "Name": "customUserAgent", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent?language=objc" - }, - { - "Name": "serverTrust", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1791920-servertrust?language=objc" - }, - { - "Name": "hasOnlySecureContent", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415002-hasonlysecurecontent?language=objc" - }, - { - "Name": "pageZoom", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/3516411-pagezoom?language=objc" - }, - { - "Name": "allowsMagnification", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414983-allowsmagnification?language=objc" - }, - { - "Name": "magnification", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414985-magnification?language=objc" - }, - { - "Name": "allowsBackForwardNavigationGestures", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414995-allowsbackforwardnavigationgestu?language=objc" - }, - { - "Name": "backForwardList", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414977-backforwardlist?language=objc" - }, - { - "Name": "canGoBack", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414966-cangoback?language=objc" - }, - { - "Name": "canGoForward", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1414962-cangoforward?language=objc" - }, - { - "Name": "allowsLinkPreview", - "URL": "https://developer.apple.com/documentation/webkit/wkwebview/1415000-allowslinkpreview?language=objc" - } - ], - "Frameworks": [ - "WebKit" - ], - "Platforms": [ - "iOS 8.0+", - "macOS 10.10+", - "Mac Catalyst 13.0+" - ], - "URL": "https://developer.apple.com/documentation/webkit/wkwebview?language=objc" -} diff --git a/schema/WKWebViewConfiguration.json b/schema/WKWebViewConfiguration.json deleted file mode 100644 index b25953b6..00000000 --- a/schema/WKWebViewConfiguration.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "Name": "WKWebViewConfiguration", - "Description": "A collection of properties that you use to initialize a web view.", - "InstanceMethods": [ - { - "Name": "setURLSchemeHandler:forURLScheme:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/2875766-seturlschemehandler?language=objc" - }, - { - "Name": "urlSchemeHandlerForURLScheme:", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/2875767-urlschemehandlerforurlscheme?language=objc" - } - ], - "TypeMethods": null, - "Properties": [ - { - "Name": "websiteDataStore", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395661-websitedatastore?language=objc" - }, - { - "Name": "userContentController", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395668-usercontentcontroller?language=objc" - }, - { - "Name": "processPool", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395659-processpool?language=objc" - }, - { - "Name": "applicationNameForUserAgent", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395665-applicationnameforuseragent?language=objc" - }, - { - "Name": "limitsNavigationsToAppBoundDomains", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/3585117-limitsnavigationstoappbounddomai?language=objc" - }, - { - "Name": "preferences", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395666-preferences?language=objc" - }, - { - "Name": "defaultWebpagePreferences", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/3194420-defaultwebpagepreferences?language=objc" - }, - { - "Name": "ignoresViewportScaleLimits", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/2274633-ignoresviewportscalelimits?language=objc" - }, - { - "Name": "suppressesIncrementalRendering", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395663-suppressesincrementalrendering?language=objc" - }, - { - "Name": "allowsInlineMediaPlayback", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614793-allowsinlinemediaplayback?language=objc" - }, - { - "Name": "allowsAirPlayForMediaPlayback", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1395673-allowsairplayformediaplayback?language=objc" - }, - { - "Name": "allowsPictureInPictureMediaPlayback", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614792-allowspictureinpicturemediaplayb?language=objc" - }, - { - "Name": "mediaTypesRequiringUserActionForPlayback", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1851524-mediatypesrequiringuseractionfor?language=objc" - }, - { - "Name": "dataDetectorTypes", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1641937-datadetectortypes?language=objc" - }, - { - "Name": "selectionGranularity", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614756-selectiongranularity?language=objc" - }, - { - "Name": "userInterfaceDirectionPolicy", - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1690322-userinterfacedirectionpolicy?language=objc" - } - ], - "Frameworks": [ - "WebKit" - ], - "Platforms": [ - "iOS 8.0+", - "macOS 10.10+", - "Mac Catalyst 13.0+" - ], - "URL": "https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc" -} diff --git a/tools/schema/go.mod b/tools/schema/go.mod deleted file mode 100644 index 787cf43d..00000000 --- a/tools/schema/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/progrium/macdriver/tools/schema - -go 1.16 - -require ( - github.com/chromedp/cdproto v0.0.0-20210323015217-0942afbea50e - github.com/chromedp/chromedp v0.6.10 -) diff --git a/tools/schema/go.sum b/tools/schema/go.sum deleted file mode 100644 index 9fdf8b63..00000000 --- a/tools/schema/go.sum +++ /dev/null @@ -1,18 +0,0 @@ -github.com/chromedp/cdproto v0.0.0-20210323015217-0942afbea50e h1:UimnzLuARNkGi2XsNznUoOLFP/noktdUMrr7fcb3D4U= -github.com/chromedp/cdproto v0.0.0-20210323015217-0942afbea50e/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= -github.com/chromedp/chromedp v0.6.10 h1:Yd4X6ngkWbn6A+hv6mUzV9kVHrPn7L4+vf2uyNbze2s= -github.com/chromedp/chromedp v0.6.10/go.mod h1:Q8L2uDLH9YFYbThK5fqPpyWa3CT4y9dqHLxaQr+Yhl8= -github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= -github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.4 h1:5eXU1CZhpQdq5kXbKb+sECH5Ia5KiO6CYzIzdlVx6Bs= -github.com/gobwas/ws v1.0.4/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/tools/schema/schema.go b/tools/schema/schema.go deleted file mode 100644 index a5ae0e1b..00000000 --- a/tools/schema/schema.go +++ /dev/null @@ -1,153 +0,0 @@ -package main - -import ( - "context" - "encoding/json" - "fmt" - "log" - "os" - "strings" - "time" - - "github.com/chromedp/cdproto/cdp" - "github.com/chromedp/chromedp" -) - -type Class struct { - Name string - Description string - InstanceMethods []InstanceMethod - TypeMethods []TypeMethod - Properties []Property - Frameworks []string - Platforms []string - URL string -} - -type Property struct { - Name string - URL string -} - -type InstanceMethod struct { - Name string - URL string -} - -type TypeMethod struct { - Name string - URL string -} - -type Topic struct { - Name string - URL string -} - -func main() { - ctx, cancel := chromedp.NewContext( - context.Background(), - //chromedp.WithDebugf(log.Printf), - ) - defer cancel() - ctx, cancel = context.WithTimeout(ctx, 10*time.Second) - defer cancel() - - var class Class - class.URL = os.Args[1] - - if err := chromedp.Run(ctx, - chromedp.Navigate(class.URL), - chromedp.WaitVisible(`main`), - chromedp.Text(`main div.topictitle h1.title`, &class.Name), - chromedp.Text(`main div.container div.description div.abstract.content`, &class.Description), - textList(`main div.summary div.frameworks ul li span`, &class.Frameworks), - textList(`main div.summary div.availability ul li span`, &class.Platforms), - ); err != nil { - log.Fatal(err) - } - - topics := "#topics div.contenttable-section div.section-content div.topic a.link" - if os.Getenv("ALLOW_DEPRECATED") == "" { - topics = topics + ":not(.deprecated)" - } - for _, n := range nodes(ctx, topics) { - var t Topic - var ok bool - if err := chromedp.Run(ctx, - chromedp.TextContent(n.FullXPathByID(), &t.Name), - chromedp.AttributeValue(n.FullXPathByID(), "href", &t.URL, &ok), - ); err != nil { - log.Fatal(err) - } - - // Handle related consts/enums later - if strings.HasPrefix(t.Name, "NS") || - strings.HasPrefix(t.Name, "CG") || - strings.HasPrefix(t.Name, "UI") || - strings.HasPrefix(t.Name, "WK") { - continue - } - - // Manual fix for less than perfect selector - if strings.HasPrefix(t.Name, "API Reference") { - continue - } - - if t.URL != "" { - t.URL = fmt.Sprintf("https://developer.apple.com%s", t.URL) - } - - if strings.HasPrefix(t.Name, "+ ") { - class.TypeMethods = append(class.TypeMethods, TypeMethod{Name: t.Name[2:], URL: t.URL}) - } else if strings.HasPrefix(t.Name, "- ") { - class.InstanceMethods = append(class.InstanceMethods, InstanceMethod{Name: t.Name[2:], URL: t.URL}) - } else { - class.Properties = append(class.Properties, Property{Name: t.Name, URL: t.URL}) - } - } - - b, err := json.MarshalIndent(class, "", " ") - if err != nil { - log.Fatal(err) - } - fmt.Println(string(b)) -} - -func nodes(ctx context.Context, sel string) []*cdp.Node { - var nodes []*cdp.Node - if err := chromedp.Run(ctx, chromedp.Nodes(sel, &nodes)); err != nil { - log.Fatal(err) - } - return nodes -} - -func textList(sel string, lst *[]string) chromedp.Tasks { - var nodes []*cdp.Node - return chromedp.Tasks{ - chromedp.Nodes(sel, &nodes), - chromedp.ActionFunc(func(ctx context.Context) error { - for _, n := range nodes { - - txt := innerText(n) - if txt != "" { - *lst = append(*lst, txt) - } - } - return nil - }), - } -} - -func innerText(node *cdp.Node) string { - var t []string - for _, c := range node.Children { - switch c.NodeType { - case cdp.NodeTypeText: - t = append(t, strings.Trim(c.NodeValue, " \n")) - case cdp.NodeTypeElement: - t = append(t, innerText(c)) - } - } - return strings.Trim(strings.Join(t, ""), " \n") -} From 3f471f990ecbbc068f4030c3c7fe90d7dabea893 Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Tue, 30 Mar 2021 17:54:38 -0500 Subject: [PATCH 2/2] remove unnecessary dev notes --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index f801caa1..d56e3e71 100644 --- a/README.md +++ b/README.md @@ -83,13 +83,6 @@ func main() { **NEW**: See [progrium/topframe](https://github.com/progrium/topframe) for a more fully-featured standalone version! -## Development Notes - -As far as we know, due to limitations of Go modules, we often need to add `replace` directives to our `go.mod` during development -to work against a local checkout of some dependency (like qtalk). However, these should not be versioned, so for now we encourage -you to use `git update-index --skip-worktree go.mod` on your checkout if you need to add `replace` directives. When updates need to -be checked in, `git update-index --no-skip-worktree go.mod` can be used to reverse this on your local repo to commit changes and then re-enable. - #### Generating wrappers Eventually we can generate most of the wrapper APIs using bridgesupport and/or doc schemas. However, the number of APIs