Skip to main content
September 22, 2011
Answered

Cross platform, multiple versions, multiple architectures.

  • September 22, 2011
  • 2 replies
  • 3351 views

I am fairly new to Illustrator plugin development.  I played around with the ADM on the Windows side and got that working.  Then realized we needed to build a plugin to run on Mac.  And although the SDK says you can target multiple platforms in the PiPL, it never really worked right.

Now I'm working on Mac with Xcode.  I'm running CS5.  Some of the machines I'm developing for are running CS4.  I've tried building the samples from the CS5 SDK and they work on my machine great.  When I build the CS4 SDK samples the tester can't load the plugin. (LiveDropShadow).  Do you think it is the version of Xcode?  I targeted the right OS version... made sure of that.

So next question.. can I build/deploy the same Flex UI in CS4 and CS5?  Any tips/suggestions?

thanks,

Will

This topic has been closed for replies.
Correct answer A. Patterson

You can absoultely hit both CS4 & CS5, Mac & PC -- we do! Hell, we used to hit CS3, CS4 and CS5

Your problem with CS5 & CS4 is probably that you're using a suite version that is only available in CS5. When Adobe updates a suite, they still make the old version available, but the headers will always use the version that shipped with their Illustrator by default (makes sense). So, for example, the Art Suite might be version 14 in CS4 and 15 in CS5. If you use the CS5 headers, kArtSuiteVersion is 15, but 15 doesn't exist in CS4.

Its easy to see if that's the problem -- add a message if AcquireSuite fails and have it print out the suite & version that failed. If that's the case, you'll just need to look at the CS4 SDK and figure out what version it shipped with (likely one less than you requested!). If you're not using anything added in the CS5 version, just switch the types & version requested to the CS4 one and after a recompile, you should be fine. Of course, this may repeat for several suites It might be faster to look at what suites you're requesting and then just check each one. A fast way is to look in the legacy folder -- if theres an AI140*.h version of your suite, that means it was updated in CS5, and you'll run into this problem.

As for the ADM, well, we had the same experience. That's why we switched to Qt. There are undoubtedly other cross-platform toolkits you could use, but that one will work (albeit with some work). The next version of Illustrator won't even have the ADM in it, so its definitely wise to avoid the ADM at this point.

I'm not too familliar with Flex, but I believe you can hit CS4 & CS5 with the same UI. I'm not the one to answer that unfortunately, as we don't use Flex. There's another thread from the last week that discussed the finer points of 3rd party vs Flash UI that you might find useful. It should be one or two down from this one in the thread list.

Good luck!

2 replies

December 7, 2011

Ok.  So I can compile the single code base with a few compiler directives (#ifdef MAC_ENV ... or #ifdef WIN_DEV) and two resource files (.rc for windows and .r for mac) in the respective IDEs.  I also needed to tell both IDEs where all the additional include files were located - this is a huge pain in the ... but at least it only has to be done once.

I have actually opened the plugin in multiple AI versions (single binary for the platform) on both platforms.  (Does a happy dance ... thanks everybody for all your help).

Unfortunately now I have to figure out how to translate mac resource positioning to windows positioning so everything looks relatively the same.  Any known documentation out there or am I just going to have to play with the positions?

A. Patterson
Inspiring
December 8, 2011

There's no translation between the two. Yeah, it sucks, we just have to eye-ball it. Frankly, even if you could translate the coordinates & such between the two, they use different fonts & such so that wouldn't be much help.

This is just another reason we do as much UI as possible in Qt as opposed to the ADM

December 8, 2011

Good Point ... I may look into QT as an option for the next round when they upgrade to the next version of AI.  I think I have a bit of time before that happens, but always good to be prepared.

thanks again.... seriously, where do I send your Christmas present?

A. Patterson
A. PattersonCorrect answer
Inspiring
September 22, 2011

You can absoultely hit both CS4 & CS5, Mac & PC -- we do! Hell, we used to hit CS3, CS4 and CS5

Your problem with CS5 & CS4 is probably that you're using a suite version that is only available in CS5. When Adobe updates a suite, they still make the old version available, but the headers will always use the version that shipped with their Illustrator by default (makes sense). So, for example, the Art Suite might be version 14 in CS4 and 15 in CS5. If you use the CS5 headers, kArtSuiteVersion is 15, but 15 doesn't exist in CS4.

Its easy to see if that's the problem -- add a message if AcquireSuite fails and have it print out the suite & version that failed. If that's the case, you'll just need to look at the CS4 SDK and figure out what version it shipped with (likely one less than you requested!). If you're not using anything added in the CS5 version, just switch the types & version requested to the CS4 one and after a recompile, you should be fine. Of course, this may repeat for several suites It might be faster to look at what suites you're requesting and then just check each one. A fast way is to look in the legacy folder -- if theres an AI140*.h version of your suite, that means it was updated in CS5, and you'll run into this problem.

As for the ADM, well, we had the same experience. That's why we switched to Qt. There are undoubtedly other cross-platform toolkits you could use, but that one will work (albeit with some work). The next version of Illustrator won't even have the ADM in it, so its definitely wise to avoid the ADM at this point.

I'm not too familliar with Flex, but I believe you can hit CS4 & CS5 with the same UI. I'm not the one to answer that unfortunately, as we don't use Flex. There's another thread from the last week that discussed the finer points of 3rd party vs Flash UI that you might find useful. It should be one or two down from this one in the thread list.

Good luck!

September 23, 2011

Ok so I think a suite conflict is my issue.  I built the new plugin template from the CS4 SDK in Xcode and it runs in CS4 and CS5 fine on my machine (I get the hello and goodbye message popups).  It still concerns me that the sample code for LiveDropShadow project from the CS4 SDK sample code built fine but doesn't open in CS4.

I'll have to find the place where it acquires the Plugin Group suite and check the version.

Along those same lines, do you recommend developing from the CS4 SDK and then tweaking it for CS5 if needed or developing from the CS5 SDK and using the previous suite versions when necessary?

thanks again,

Will

A. Patterson
Inspiring
September 26, 2011

It depends on whether you need CS5 functionality. As soon as you want to call something only found in the CS5 SDK, you're kind of stuck going with the CS5 headers -- I strongly recommend you do not mix the headers from the two SDKs. If you don't even call anything CS5-specific though, CS4 headers are just fine (though I'd still test it in CS5!).