Python Script Engine  1.0
GL Studio Editor Python Script API
Editor Class Reference

Module Methods

Methods that can be called on the module.

bool RegisterDragAndDropHandlers (void *dragHandler, void *dropHandler)
 
void ClearDragAndDropHandlers ()
 
DocumentArrayGetAllDocuments ()
 
void ForceEditorRefresh ()
 
void GenerateCurrentDocument ()
 
void GenerateCurrentDocumentAndChildren ()
 
void GenerateAllDocuments ()
 
void CleanCurrentDocument ()
 
void CleanCurrentDocumentAndChildren ()
 
void CleanAllDocuments ()
 
std::vector< String > GetAvailableCodeGenerators ()
 
String GetActiveCodeGenerator ()
 
bool SetActiveCodeGenerator (String codeGeneratorName)
 
CodeGenerator GetCodeGenerator (String codeGeneratorName)
 
String SetCodeGeneratorOptions (String codeGeneratorOptions)
 
String GetCodePathForCurrentGenerator (Document *doc=nullptr)
 
String GetResourcesPathForCurrentGenerator (void)
 
String GetCurrentProjectFileDirectory ()
 
ProjectGetCurrentProject ()
 
void ForceRefreshCurrentProject ()
 
void GetVersionInfo (int *major, int *minor, int *build)
 
Document GetCurrentDocument ()
 
Document GetDocumentByName (String docName)
 
Document NewDocument (String filename="")
 
Document OpenDocument (String fileName)
 
void SaveAllDocuments ()
 
void CloseAllDocuments ()
 
String GetVersionInfoString ()
 

Detailed Description

Editor module that contains methods to run on the Editor instance itself.

Member Function Documentation

void CleanAllDocuments ( )

Cleans all of the code for a given document.

Exceptions
CEIException
void CleanCurrentDocument ( )

Cleans the code for a given document.

Exceptions
CEIException
void CleanCurrentDocumentAndChildren ( )

Cleans the code for a given document and any referenced children.

Exceptions
CEIException
void ClearDragAndDropHandlers ( )

Clear all file drag and drop handlers currently added.

void CloseAllDocuments ( )

Closes all open documents.

Exceptions
CEIException
void ForceEditorRefresh ( )

Force refresh of editor user interface.

void ForceRefreshCurrentProject ( )

To be called when we know we need to refresh the project and its packages.

Since
GL Studio 6.0.1
void GenerateAllDocuments ( )

Generates all of the code for a given document.

Exceptions
CEIException
void GenerateCurrentDocument ( )

Generates the code for a given document.

Exceptions
CEIException
void GenerateCurrentDocumentAndChildren ( )

Generates all of the code for a given document and any referenced children.

Exceptions
CEIException
String GetActiveCodeGenerator ( )

Get a list of available code generators.

See also
GetAvailableCodeGenerators()
SetActiveCodeGenerator()
DocumentArray * GetAllDocuments ( )

Get a list of all loaded documents.

Returns
List of loaded documents
std::vector< String > GetAvailableCodeGenerators ( )

Get a list of available code generators.

See also
GetActiveCodeGenerator()
SetActiveCodeGenerator()
CodeGenerator GetCodeGenerator ( String  codeGeneratorName)

Gets the code generator object by name.

Parameters
codeGeneratorNameThe name of the code generator to return. Should be one of the strings returned by GetAvailableCodeGenerators().
Returns
non isNULL() on success.
See also
GetAvailableCodeGenerators()
GetActiveCodeGenerator()
String GetCodePathForCurrentGenerator ( Document doc = nullptr)

The the code generation output path for the currently active generator.

This can be different from the document specified path based on project settings.

Parameters
docthe document to use when cacluating the path
Returns
the path
Deprecated:
Use Deployment::GetGeneratedCodeRoot() instead.
Document GetCurrentDocument ( )

Gets the current document.

Returns
current document ( isNULL on returned value returns true if there is no current doc )
Project * GetCurrentProject ( )

Returns the project object that is currently in use, or null if there is none.

Since
GL Studio 6.0.1
String GetCurrentProjectFileDirectory ( )

Returns the project directory that is currently in use.

Returns
the path to the project file, or empty string if there is none
See also
GetCurrentProject()
Document GetDocumentByName ( String  docName)

Gets the document with the given name, if open.

Parameters
docNamename of the document to get
Returns
desired document ( isNULL on returned value returns true if there is no document with the given name open )
String GetResourcesPathForCurrentGenerator ( void  )

The the resources output path for the currently active generator.

Returns
the path
Deprecated:
Use Deployment::GetGeneratedResourcesRoot() instead.
void GetVersionInfo ( int *  major,
int *  minor,
int *  build 
)

Returns a tuple of the version info in the form of (major, minor, build)

Returns
version info in tuple format (major, minor, build)
Since
GL Studio 6.0.1
String GetVersionInfoString ( )

Returns a string containing the version info a string concatination of GetVersionInfo()

Returns
a string containing the editor version info
Since
GL Studio 6.0.1
Document NewDocument ( String  filename = "")

Creates a new document and makes it the current document.

Parameters
filenameoptional filename to give the new document
Returns
a new document that is the current document
Document OpenDocument ( String  fileName)

Opens a new document and makes it the current document.

Parameters
fileNamename of file to load
Returns
loaded document ( isNULL on returned value returns true if no doc loaded )
bool RegisterDragAndDropHandlers ( void *  dragHandler,
void *  dropHandler 
)

Register file drag and drop handlers.

Parameters
dragHandlerPython callable that takes a filename to see if the drop handler will accept it.
dropHandlerPython callable that takes a filename to handle the drop
Returns
true if the handlers were added.
void SaveAllDocuments ( )

Saves all open documents.

Exceptions
CEIException
bool SetActiveCodeGenerator ( String  codeGeneratorName)

Set the current code generator.

Parameters
codeGeneratorNameThe name of the code generator to make active. Should be one of the strings returned by GetAvailableCodeGenerators().
Returns
Indicates if the requested code generator was found. If false, this function had no effect.
See also
GetAvailableCodeGenerators()
GetActiveCodeGenerator()
String SetCodeGeneratorOptions ( String  codeGeneratorOptions)

Pass some options to configure the current code generator.

Parameters
codeGeneratorOptionsThe options in KEY=VALUE pairs separated by spaces.
Returns
String contains a list of failed configuration options. If empty, all applied successfully. If not empty, all that are not here were applied.
Note
This is an advanced function that may be deprecated later in favor of CEI interfaces for the code generators.

The documentation for this class was generated from the following file: