How to implement a Cocoa-based Adobe Photoshop plugin

后端 未结 3 1428
暖寄归人
暖寄归人 2021-02-09 00:32

Cocoa used to work on CS3 with the trick of putting a Cocoa bundle inside the main Carbon plugin bundle, loading it from Carbon and issuing a NSApplicationLoad(). That\'s becaus

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-09 01:08

    I just started working on writing a Cocoa-based plugin for CS4. Really, there is almost no information out there on this topic, and I've been figuring it out as I go.

    • Start from this Apple example, and make sure you download the whole project, because there are a few little details missing from the text:

    Carbon/Cocoa

    • Pick one of the Photoshop SDK examples (I used ColorMunger), and keep it simple to start, so just try to replace the "About" dialog box, using the Apple example as your template. Once you have that working with no memory issues, you should be on your way.

    I've been a Java and Ruby programmer for 10 years, so my C/C++ foo is rusty, and I'm just learning Objective C as I go. Two "gotchas" I ran into, just in case....

    • do NOT create a controller object in your NIB/XIB file. Because, based on that Apple example, the controller opens up the NIB file in it's init method, and you get a really interesting recursive loop
    • The Apple example is embedding the Cocoa stuff in a Carbon based C app. The Adobe examples are all C++. Don't forget your extern "C" {} in your header file.

提交回复
热议问题