Customizing Views Studio With the Prototypes Extension
This section describes the most important classes that you can derive to extend Views Studio with the Prototypes extension.
Extension Class
The Views Studio extension is represented by the IlvStPrototypeExtension class, which is declared in <ILVHOME>/studio/ivstudio/protos/stproto.h:
class ILVSTPRCLASS IlvStPrototypeExtension
: public IlvStExtension {
public:
IlvStPrototypeExtension(IlvStudio* editor);
static IlvStPrototypeExtension* Get(IlvStudio* editor);
};
An instance of this class (or a subclass) must be created after the IlvStudio object is created and before the initialize method is called. The static Get method returns the (unique) instance of IlvStPrototypeExtension.
Buffer Classes
Views Studio defines four subclasses of IlvStBuffer. These classes are also declared in <ILVHOME>/studio/ivstudio/protos/stproto.h.
IlvStPrototypeManagerBuffer
The IlvStPrototypeManagerBuffer class represents a buffer of the “Prototype Instances (2D)” type. The NewPrototypeManagerBuffer command creates an instance of this class. The manager controlled by an IlvStPrototypeManagerBuffer is an instance of IlvManager:
class ILVSTPRCLASS IlvStPrototypeManagerBuffer
: public IlvStBuffer
{
public:
IlvStPrototypeManagerBuffer(IlvStudio*,
const char* name,
IlvManager* = 0);
};
IlvStPrototypeEditionBuffer
The IlvStPrototypeEditionBuffer class represents a buffer of the “Prototype” type, that is, a buffer used to edit a prototype. The NewPrototypeEditionBuffer command creates an instance of this class. The manager controlled by an IlvStPrototypeEditionBuffer is an instance of IlvGadgetManager:
class ILVSTPRCLASS IlvStPrototypeEditionBuffer
: public IlvStPrototypeManagerBuffer
{
public:
IlvStPrototypeEditionBuffer(IlvStudio*,
const char* name,
IlvManager* = 0);
void editPrototype(IlvPrototype* prototype,
IlBoolean fromLib = IlTrue,
const char* filename = 0);
IlvPrototype* getPrototype();
IlvPrototype* getEditedPrototype();
};
The editPrototype method initializes the buffer so that it can edit the prototype specified by prototype. A copy of the prototype is made and is stored in the associated manager. The fromLib argument specifies whether the edited prototype is stored in a prototype library contained in the Prototypes palette or if the prototype is a “standalone” prototype loaded from a .ivp file. In the second case, the optional filename argument can contain the full path name of the .ivp file.
The getPrototype() method returns the prototype contained in the buffer. The getEditedPrototype() method returns the “original” prototype if the buffer is currently editing a prototype from a library. Otherwise, it returns 0.
Published date: 05/24/2022
Last modified date: 02/24/2022