GithubHelp home page GithubHelp logo

Comments (9)

programmingkidx avatar programmingkidx commented on May 17, 2024

I am reading the code in the cocoa package currently. This package has 35 files in it. It has one big file called cocoa_objc.gen.go. This file is over 21,000 lines long and has the implementation of many objective-c classes in it. One thing I don't understand yet is why there are other files in this folder. For example the cocoa_objc.gen.go file has the implementation of several NSFont methods. But there is still a file in the package called NSFont.go. This file only has one method implemented in it. Why is the NSFont.go file needed?

from macdriver.

programmingkidx avatar programmingkidx commented on May 17, 2024

I did more research on the core package and found out it has the same format. The package contains one large file called core_objc.gen.go and a bunch of little files with the names of classes in objective-c. The core_objc.gen.go file seems to have code in it that translates objective-c to c, then from c to go. The other files seem to make the go code more human-friendly.

I am guessing the "gen" in core_objc.gen.go is for "generated". If this file was generated using a program could we see this program?

from macdriver.

programmingkidx avatar programmingkidx commented on May 17, 2024

Just wanted to note if this tutorial is made, a section should be included that tells the user how to test out changes to this project.

from macdriver.

progrium avatar progrium commented on May 17, 2024

You're right, and there is tooling here to generate that code based on schemas produced by the project macschema which is all still under development, though not actively by me at the moment. It will take some time for me to get back into it all and make sure it all works and create tutorials like this but thanks to you and others, I'm trying to find ways to prioritize it.

from macdriver.

progrium avatar progrium commented on May 17, 2024

Some of this has been started in the project wiki here, for example:
https://github.com/progrium/macdriver/wiki/HowToAddTypes

from macdriver.

programmingkidx avatar programmingkidx commented on May 17, 2024

I made the tutorial: https://github.com/progrium/macdriver/wiki/How-to-Contribute
Please let me know what you think. Suggestions and corrections are always welcomed.

from macdriver.

tmc avatar tmc commented on May 17, 2024

I made the tutorial: https://github.com/progrium/macdriver/wiki/How-to-Contribute Please let me know what you think. Suggestions and corrections are always welcomed.

it might be better to suggest using a go.work file vs the replace directive.

from macdriver.

programmingkidx avatar programmingkidx commented on May 17, 2024

@tmc the issue with that is it requires Go 1.18 or higher. There probably are people who are still using older versions of Go who might want to contribute.

from macdriver.

progrium avatar progrium commented on May 17, 2024

Closing for now. At some point I'll try to clean it up, but good first pass.

from macdriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.