[SDK] Create hybrid plugin that includes kModelPlugin and kUIPlugIn
I want to create a plugin that has some panel where user enters some input, according to that input model side of the plugin decides whether or not provide a service. I have one custom singleton class which provides a service for a model plugin, with UI side of the plugin I want to access that class instance and change some of its variables which serve as a flag: on/off
I've tried defining the PluginVersion resource in .fr file like this: (including both kModelPlugin and kUIPlugin)
resource PluginVersion (kSDKDefPluginVersionResourceID)
{
kTargetVersion,
kMyPluginID,
kSDKDefPlugInMajorVersionNumber, kSDKDefPlugInMinorVersionNumber,
kSDKDefHostMajorVersionNumber, kSDKDefHostMinorVersionNumber,
kCHLCurrentMajorFormatNumber, kCHLCurrentMinorFormatNumber,
{ kInDesignProduct, kInDesignServerProduct, kInCopyProduct },
{ kWildFS },
{ kModelPlugIn, kUIPlugin },
SDK_DEF_MAKE_VERSIONSTRING(kSDKDefPlugInMajorVersionNumberForResource, kSDKDefPlugInMinorVersionNumberForResource, kSDKDefPlugInStepVersionNumberForResource, kBuildNumber)
};But that just resulted in syntax error.
So, I've just tried including UI component changing the PluginVersion. I just took necessary parts from some UI plugin in skdsamples and merged with my model plugin.
When I launcht the InDesign I got this error message to pop up:
Model plugin MYTEST.SDK.PLN is attempting to use UI interface implementation kCPanelMenuDataImpl provided by plugin WIDGETS.RPLN in class kTestPanelWidgetBoss. A UI interface implementation can be added to a model boss only via the AddIn directive in a UI plugin resource, and that implementation will not be present in the boss when running in a background task.
From the error message, as I understood, I need to create separate plugins(?), and somehow tell the UI plugin to connect with Model plugin using the Addin directive... If I got it right, is it still possible to access my model plugin's custom service class instance from UI plugin and change value of the static variable?
More importanlty, how do I achieve this all to work together?? I mean how to add via Addin directive.
Responding with some working code example would be much appreciated! Thanks!
