Table Of Contents

Graph IDEProgramming ► Plugin

Using plugins is a two step process. First you write and compile the plugin using Xcode and then you load it in. Loading it is simple, just select the Graph IDE menu item ToolsProgrammingLoad Plugin... and open the plugin you make. The rest of this section gives instructions on making the plugin.

Note: Only the Mac version supports Plugins. For other platforms your code must be linked directly into the Graph IDE project. See GitHub/VVI for additional information.

Premade Xcode Project

The fastest way to start with plugins is to use a premade one. Plugin resources are available from these links:

LinkDescription Of Resource
ExamplePlugin.zipThe compressed ExamplePlugin project located on your disk within this manual.
ExamplePlugin.zipThe compressed ExamplePlugin project located at the vvidget.org web site.
XcodeThe Xcode application on the Mac App Store.

Download the ExamplePlugin zip file, uncompress, launch the Xcode project and click Run to make the plugin. The framework links and source code are already setup and ready to go. Eventually you may wish to make your own plugin project from scratch. For that purpose read the section below.

Xcode Instructions

The following gives the steps for making a Xcode plugin that can be utilized for programming graphics.

Calling the Plugin

In the source code above the Function object class was subclassed. To instantiate an object of your own subclass allocate it in a call like [MyFunction alloc] instead of [Function alloc]. Notice how you subclassed VVPUBLIC_Function. As a matter of convenience to programming, the parser strips the prefix VVPUBLIC_ from the class name when appropriate however in Xcode the prefix is not stripped and must be included when subclassing a known class.

The instructions above detail how to make the plugin. The plugin is applicable to programming the Function graphic. You can call upon the object of your own class and its methods using script code such as the following.

Script without saving state
@@class() MyFunction:Object

@@method(public, class) (id)alloc;
@@method(public, instance) (id)init;
@@method(public, instance) (void)doAllTheWork;
@@method(public, instance) (void)release;

@@end

{
id myFunction;

myFunction = [[MyFunction alloc] init];

[myFunction doAllTheWork];

[myFunction release];

}

If your plugin needs to save state within the Graph IDE document (see the plugin example project) then the script is written as follows.

Script that permits the instance of MyFunction to save state in the Graph IDE document.
@@class() MyFunction:Object

@@method(public, class) (id)stored;
@@method(public, instance) (void)doAllTheWork;

@@end

{
id myFunction;

myFunction = [MyFunction stored];

[myFunction doAllTheWork];

}

The method doAllTheWork can implement most anything such as DSP processing, FEM modeling, stock data feed retrievals, statistical algorithms, etc.

The ExamplePlugin given at the links above implements a few other features such as saving a MyFunction instance state. It also contains some programming notes and comments. Please email support@vvi.com if you have difficulty obtaining the plugin or have a plugin question.




© Copyright 1993-2022 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.