Sunday, April 4, 2010

Filter plugin user interface

I'm trying to write a filter plugin on the Mac, and I'm having a hell of a time getting any user interface up.



I initially started trying to modify the Dissove UI, like everybody does. After several hours trying to hack the .R file, I eventually decided that there had to be a better way than using all of this 1994 crap. I went looking for an alternative.



I did an Illustrator plugin recently that used ADM for its UI, and created all of its controls programmatically (to avoid having to use the ****** .R format that nobody supports any more), so I tried that approach here. Unfortunately, it appears that you can't use ADM in a filter plugin, because it doesn't get an SPPluginRef in its main entry point. Can this be true?



Is there a better way to do UI in a filter plugin on the Mac? It's pathetic that Adobe is stuck in the last century - not that I'm a big fan of Cocoa, but at least it's supported on current OS versions!



Thanks for any assistance or advice,

Aaron
Filter plugin user interface
It just occurred to me that I might use HIView with a Carbon nib file. Has anybody tried this? Can anybody confirm that this will or will not work, or point out any pitfalls to avoid?



Thanks,

Aaron
Filter plugin user interface
I don't see the problem with using Rez resources. Current versions of OS X include the resource compiler and decompiler.



See http://telegraphics.com.au/sw/ for dozens of plugin source code examples which build and run on OS X through Photoshop CS4.

The problem is that, while the Rez format is supported by built-in tools, the resulting .rsrc file is not. For example, there's no way (that I know of) to visually edit dialog layouts other than buying the ridiculously-expensive and largely-obsolete Resourcerer.



Bottom line, the whole technology is obsolete. It locks you into using crappy old mostly-deprecated Apple APIs, requires bizarre workarounds like LDEFs, and doesn't allow you to access all the capabilities of OS X.



I've got a Carbon UI working now using a NIB file, and I'm much happier. No real problems making it work under Photoshop. Now, if I could just get this damn DataBrowser control to call my callbacks...



Thanks,

Aaron

It depends a bit on the complexity of the UI, I think. For simple interfaces Rez can be just fine.



There is ResEdit as a free resource layout editor, but the claim that it's aging has some merit: I first used that program about 22 years ago. :)

There should be a SPPluginRef in the FilterRecord. Look towards the bottom I think after version 5 maybe. I would not suggest using ADM as we are looking to remove it as it doesn't work well in the new world of 64 bit architectures. Although creating your dialog in a text based format is not nice it is nice when you start doing diffs and managing it in source control. I wish I had a better answer for you but...

No comments:

Post a Comment