Forum

Return/get in VL

Hi, is there a way to implement interface methods with a return/getter in VL?

The return entry in the gray book is empty, so I assume it’s not possible?
Maybe it could work with a specially named output pin that would compile to a return?

I’m trying to add pen input to a Skia window, using the RealTimeStylus class.
This however requires implementing the IStylusSyncPlugin interface. Handling methods have just input arguments, which is fine, but the DataInterest method needs to return the interest mask.

Do I need to resort to C# for this atm?

The equivalent code would be eg:
public DataInterestMask DataInterest { get { return DataInterestMask.StylusDown | DataInterestMask.Packets | DataInterestMask.StylusUp; } }

Off-topic, why is Skia using Forms instead of WPF?

how did you call your getter method in the patch? how does it’s signature look like?

I called it DataInterest

This seems to be the right method to implement a getter interface method
image

The output name is the method name with spaces (suggested in node browser and also visible in decompiled code view after the DataInterest method is added)

Now adding the plugin does no longer complain.

Maybe this info could be added to the gray book?

the getter methods of properties have a different name than the property itself. i think you should call it get_DataInterest. see also:

No no, the way that I described above works well for this already.

The moment you DataInterest is added, the get_DataInterest gets auto-generated, with the correct typing, in a way that takes output from the DataInterest method. Only the spaces are slightly confusing.

So this works quite well actually, good job whoever implemented it. Just could use documentation.

Creating an explicit get_DataInterest method creates a VL method that is incompatible with this declaration - one that returns an instance of the implementing class itself.

What I’m having issues with now is getting an actual readout from the Plugin or even seeing any styli listed. This issue is however unrelated to this topic and I suspect the cause is missing permissions of the application and I don’t think that there’s anything I can do about that :(

https://docs.microsoft.com/en-us/windows/desktop/tablet/partial-trust-considerations-for-the-stylusinput-apis

you can try to add the permissions to vvvv.exe.config file which is besides vvvv.exe.

but i would also test whether the interface implementation actually works by calling the property getter of the interface to see if the returned value is the one you put in the IOBox.