Re: Retrieving plug-in parameters in custom view in FxPlug 4
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=wf8fMM1v8oUywtE2v8O/ntxi97gaa1Yn5TQjgrJi1 /U=; b=kvKAQvpNewLiaqZxKAWkjwAsGu8MbQg6t3TvntOYMxyN0uYiX3sb8tw6u CMrfVh29f654eqkyiFWpWoBLIZJBO0JqRtkHOPdTwetkegOj1g9F+3TAnSIRg4Kd dQ1dfwoJdUI0Ds2YZ1DfLBzQAB2ddTA4jbGcA64onvqGuGfsDHOrDzkusRDL9Yha vCMR+yEi2w2bQpAmvDZG8wn57KhAE0xXBL5ozxJsdOIE+VFidhI07iAzb7ciw9HU kTNVIzgm3q2YajwGoyQ9poVoQX5p6xzQGCf79vkRYifuwztMwMvl/IkxxZRLkEMA Cus922LH8leHsv27m4Rdt0LI7XobA== User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Thank you for the reply, Darrin. Please find my comments inline. On 19/05/2020 2:32 am, Darrin Cardani wrote: Sergey, Answers inline below: On May 17, 2020, at 7:09 PM, Sergey via Pro-apps-dev <pro-apps-dev@lists.apple.com> wrote: Good day pro-apps-dev, We are in the process of porting our plug-in onto FxPlug 4 (right now we are still on v2.x) and we struggle with making the basic things work via XPC. Our plug-in has its own custom UI based on Qt which is triggered by a Push Button. I am following the FxSimpleColorCorrector example and have been able to create a custom view (just a regular rectangular NSView with a child NSButton; should you ask, I cannot use addPushButtonWithName for the purpose as its selector is handled in the background thread which is not suitable for UI tasks, its visual representation is not perfect either) You can always use -performSelectorOnMainThread: or dispatch_async(dispatch_get_main_queue(), …) to do things on the main UI thread. Now obviously, our custom dialog must be pre-filled with current values of the custom parameters. However the FxParameterRetrievalAPI_v6 seems to be inaccessible in the handler selector of the push button. The _apiManager apiForProtocol returns nil no matter what. Funny enough, in the FxSimpleColorCorrector example the FxParameterRetrievalAPI_v6 is accessible inside drawRect selector, but not accessible inside mouseDown (which is similar to my situation). Is there a reason why the interface is inaccessible in some selectors, but accessible in others? Can you suggest any solution/workaround? In general we have to be careful to keep data exchange between the host and the plug-in to a minimum to keep performance tolerable for users. So rather than allowing all selectors to be used during every plug-in call, we now have to be very selective and find creative ways to cache data on the plug-in, while still being careful to keep it up-to-date. It’s can be difficult to get right sometimes. One option right now would be to cache the data yourself for use later on. Since you get called to generate the custom data, you know every time it gets changed. That said, please file a feedback issue and we’ll look into it. Darrin Best regards, Sergey _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com This email sent to dcardani@apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com I've considered this option and it seems to work. Except that FxParameterRetrievalAPI_v6 is not available in the context of the main thread either. (I've checked and it is actually accessible from the button selector in the BG thread, so can be used from there). Is there an API to change/remove the duplicated text though? Understood. I'll try to proceed with the caching option for now. May I ask you to have a look at another thread that I've started ("Accessing and displaying frames in custom view in FxPlug 4") - that seem to be a major blocker for us.
participants (1)
-
Sergey via Pro-apps-dev