GithubHelp home page GithubHelp logo

Comments (3)

krevis avatar krevis commented on June 3, 2024

I'm assuming you're asking in reference to this Stack Overflow question.

This project is just some throwaway test code, and I haven't used it for anything practical. I just put this code together to see if CARemoteLayer worked at all, to answer this other Stack Overflow question and to satisfy my own curiosity.

Sorry if you were expecting Real Authoritative Documented Answers from People Who Know What They're Doing, but this just isn't that kind of situation.

Anyway, if I had to guess, you probably want something like:

  1. In your local view, override the NSResponder method you're interested in (e.g. -mouseDown:)
  2. It should marshal the arguments into an XPC dictionary (perhaps using NSCoding to serialize objects into data)
  3. And send the dictionary over XPC to the service.
  4. The service receives the dictionary, unmarshals/deserializes the contents of the message, and does the appropriate thing.

Use -[RLAppDelegate changeColor:] as an example of how to do parts of 2 and 3. RemoteLayerDemoService_peer_event_handler() handles step 4.

The devil's in the details, of course. I suspect it wouldn't make a lot of sense to try to forward every method in NSResponder as-is.

Does that help at all?

from remotelayerdemo.

avaidyam avatar avaidyam commented on June 3, 2024

Yes, yes I am. I actually have used your demo previously in conjunction with TwUI which is a layer-backed UIKit for Mac, and I did get this mostly working, but with major bugs and glitches. Previously I used raw mach ports (shudder) and a simple proxy object (reimplemented NSProxy) to get this to work, as I was targeting 10.6 as well. Since then, I've transitioned to 10.7+, AppKit, and began investigating XPC and CARemoteLayer*.

This post actually helps quite a bit, and I'd mark it as the answer if you'd post it on SO ;)
I'll be experimenting with this and I may fork this repo as an expanded demo!

from remotelayerdemo.

avaidyam avatar avaidyam commented on June 3, 2024

@krevis Almost five years later, the solution to this question has been implemented by Apple in ViewBridge.framework (10.10+) and my exploration into this can be found here.

from remotelayerdemo.

Related Issues (2)

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.