HDK
|
A class for managing the languages and custom data types in VOPs. More...
#include <VOP_LanguageManager.h>
Public Types | |
typedef void(* | EditCallback )(const UT_StringRef &type_name) |
For registering a GUI editor callback. More... | |
Public Member Functions | |
void | getLanguageNames (UT_StringArray &lang_names) const |
Gets the list of all available languages. More... | |
bool | hasLanguage (const UT_StringRef &lang_name) const |
Tests if the manager has a definition for the given name. More... | |
VOP_TypeDefinitionSource * | getLanguageSource (const UT_StringRef &lang_name) const |
Gets the source that provides the full definition for the language. More... | |
void | registerLanguage (const UT_StringRef &lang_name, VOP_TypeDefinitionSource &src) |
void | unregisterLanguage (const UT_StringRef &lang_name) |
void | getTypeDefinitionNames (UT_StringArray &type_names) const |
Gets the list of all available type definitions. More... | |
bool | hasTypeDefinition (const UT_StringRef &type_name) const |
Tests if the manager has a definition for the given name. More... | |
VOP_TypeDefinitionHandle | getTypeDefinitionHandle (const UT_StringRef &type_name) const |
Gets the type definition based on the type name. More... | |
VOP_TypeDefinitionSource * | getTypeDefinitionSource (const UT_StringRef &type_name) const |
Gets the source tha provides the full definition for the type. More... | |
void | registerTypeDefinition (const UT_StringRef &type_name, VOP_TypeDefinitionSource &src, const UT_StringRef &old_type_name=UT_StringRef()) |
void | unregisterTypeDefinition (const UT_StringRef &type_name) |
void | dirtyTypeDefinition (const UT_StringRef &type_name) |
void | generateUniqueTypeName (UT_String &type_name, bool use_guid) |
Obtains a unique type name not used in the manager yet. More... | |
void | editType (const UT_StringRef &type_name) |
Brings up a type editor GUI for editing the given type. More... | |
VOP_TypeDefinitionFileLoader & | getFileLoader () |
Returns an object that loads and saves the definitions to and from file. More... | |
void | unregisterTypeDefinitionSource (VOP_TypeDefinitionSource &src) |
UT_NotifierImpl< const VOP_LanguageManagerEvent & > & | getEventNotifier () |
VOP_LanguageManager () | |
~VOP_LanguageManager () | |
VOP_LanguageInfo | getLanguageInfoFromRenderMask (const UT_StringRef &mask) const |
VOP_LanguageType | getLanguageTypeFromRenderMask (const UT_StringRef &mask) const |
bool | isMantraVexFromRenderMask (const UT_StringRef &mask) const |
const VOP_Language * | getLanguage (const VOP_LanguageInfo &lang_info) const |
const VOP_Language * | getLanguage (const UT_StringRef &lang_name) const |
const VOP_Language * | getLanguage (VOP_LanguageType type) const |
Static Public Member Functions | |
static void | setEditCallback (VOP_LanguageManager::EditCallback cb) |
A class for managing the languages and custom data types in VOPs.
Definition at line 37 of file VOP_LanguageManager.h.
typedef void(* VOP_LanguageManager::EditCallback)(const UT_StringRef &type_name) |
For registering a GUI editor callback.
Definition at line 139 of file VOP_LanguageManager.h.
VOP_LanguageManager::VOP_LanguageManager | ( | ) |
Default constructor and destructor
VOP_LanguageManager::~VOP_LanguageManager | ( | ) |
Default constructor and destructor
void VOP_LanguageManager::dirtyTypeDefinition | ( | const UT_StringRef & | type_name | ) |
Marks the given type definition as dirty. The next time someone requests full definition handle, the manager will ask the source for an update before returning the refreshed definition. Issues an event about type definition change.
void VOP_LanguageManager::editType | ( | const UT_StringRef & | type_name | ) |
Brings up a type editor GUI for editing the given type.
Obtains a unique type name not used in the manager yet.
|
inline |
Gets the notifier that sends events triggered by various changes to the data structures overseen by the manager.
Definition at line 161 of file VOP_LanguageManager.h.
VOP_TypeDefinitionFileLoader& VOP_LanguageManager::getFileLoader | ( | ) |
Returns an object that loads and saves the definitions to and from file.
const VOP_Language* VOP_LanguageManager::getLanguage | ( | const VOP_LanguageInfo & | lang_info | ) | const |
Returns language of a given type. NOTE: returned language is often held by VOP_Node, so can't be deleted.
const VOP_Language* VOP_LanguageManager::getLanguage | ( | const UT_StringRef & | lang_name | ) | const |
Returns language of a given type. NOTE: returned language is often held by VOP_Node, so can't be deleted.
|
inline |
Returns language of a given type. NOTE: returned language is often held by VOP_Node, so can't be deleted.
Definition at line 64 of file VOP_LanguageManager.h.
VOP_LanguageInfo VOP_LanguageManager::getLanguageInfoFromRenderMask | ( | const UT_StringRef & | mask | ) | const |
Returns language type guessed from shader's render mask. Prefer to use language info rather than type, because it can handle user-defined languages.
void VOP_LanguageManager::getLanguageNames | ( | UT_StringArray & | lang_names | ) | const |
Gets the list of all available languages.
VOP_TypeDefinitionSource* VOP_LanguageManager::getLanguageSource | ( | const UT_StringRef & | lang_name | ) | const |
Gets the source that provides the full definition for the language.
|
inline |
Returns language type guessed from shader's render mask. Prefer to use language info rather than type, because it can handle user-defined languages.
Definition at line 52 of file VOP_LanguageManager.h.
VOP_TypeDefinitionHandle VOP_LanguageManager::getTypeDefinitionHandle | ( | const UT_StringRef & | type_name | ) | const |
Gets the type definition based on the type name.
void VOP_LanguageManager::getTypeDefinitionNames | ( | UT_StringArray & | type_names | ) | const |
Gets the list of all available type definitions.
VOP_TypeDefinitionSource* VOP_LanguageManager::getTypeDefinitionSource | ( | const UT_StringRef & | type_name | ) | const |
Gets the source tha provides the full definition for the type.
bool VOP_LanguageManager::hasLanguage | ( | const UT_StringRef & | lang_name | ) | const |
Tests if the manager has a definition for the given name.
bool VOP_LanguageManager::hasTypeDefinition | ( | const UT_StringRef & | type_name | ) | const |
Tests if the manager has a definition for the given name.
bool VOP_LanguageManager::isMantraVexFromRenderMask | ( | const UT_StringRef & | mask | ) | const |
Returns language type guessed from shader's render mask. Prefer to use language info rather than type, because it can handle user-defined languages.
void VOP_LanguageManager::registerLanguage | ( | const UT_StringRef & | lang_name, |
VOP_TypeDefinitionSource & | src | ||
) |
Registers a new vop language whose full definition is provided by the source upon request. If 'lang_name' already exists, the new source (and new definition) is going to be used after this registration.
void VOP_LanguageManager::registerTypeDefinition | ( | const UT_StringRef & | type_name, |
VOP_TypeDefinitionSource & | src, | ||
const UT_StringRef & | old_type_name = UT_StringRef() |
||
) |
Registers a new vop type whose full definition is provided by the source upon request. If 'type_name' already exists, the new source (and new definition) is going to be used after this registration. If 'old_type_name' is provided, the old type is renamed to the new name whose full definition is provided by the given source; after renaming, the old name is unregistered and becomes unavailable. Issues an event about added or renamed type.
|
static |
void VOP_LanguageManager::unregisterLanguage | ( | const UT_StringRef & | lang_name | ) |
Removes the language from the manager. After unregistration, this language definition will no longer be availble from manager. Issues an event about removed language.
void VOP_LanguageManager::unregisterTypeDefinition | ( | const UT_StringRef & | type_name | ) |
Removes the type from the manager. After unregistration, this type definition will no longer be availble from manager. Issues an event about removed type.
void VOP_LanguageManager::unregisterTypeDefinitionSource | ( | VOP_TypeDefinitionSource & | src | ) |
A convenience method that unregisters all the types and languages associated with the given source. Issues events about removed types.