36 #define MAX_UNDOREDO 32
63 void AddMaterial(
const char*
name,
const char* filename,
const char* sourceText =
NULL,
bool addUndo =
true);
bool IsRedoAvailable()
Returns true if a redo operation is available.
MaterialDoc * GetInProgressDoc(idMaterial *material)
Checks the current list of in progress MaterialDoc objects to see if a MaterialDoc object already exi...
bool IsCopyMaterial()
Returns true if there is a material in the copy buffer.
void ClearCopy()
Clears the copy buffer for a material.
bool IsCopyStage()
Returns true if there is a stage in the copy buffer.
idStr GetUniqueMaterialName(idStr name)
Returns a unique material name given a base name.
void DeleteMaterial(MaterialDoc *material, bool addUndo=true)
Deletes a material.
void ApplyAll()
Applies all materials that have been changed.
idStr GetCopyMaterialName()
Returns the name of the material in the copy buffer.
void SaveAllMaterials()
Saves all materials that have been changed.
idList< MaterialView * > materialViews
void MaterialSaved(MaterialDoc *materialDoc)
Called when a material has been saved and notifies all views of the save.
void StageDeleted(MaterialDoc *materialDoc, int stageNum)
Called when a stage has been deleted and notifies all views of the change.
void RegisterMaterialView(MaterialView *view)
Registers an object to receive notifications about changes made to materials.
void GetCopyStageInfo(int &type, idStr &name)
Returns information about the stage in the copy buffer.
idList< MaterialModifier * > undoModifiers
Base class for modifications that can be made to a material that can be undone and redone...
void ClearCopyStage()
Clears the copy buffer for copied stages.
void Undo()
Performs the first available undo operation.
GLuint GLuint GLsizei GLenum type
~MaterialDocManager(void)
Destructor for MaterialDocManager.
void NotifyViews(MaterialDoc *materialDoc, int notifyType,...)
Notifies all registered views of a material event.
bool DoesFileNeedApply(const char *filename)
Returns true if the specified file needs to be applied and false otherwise.
idHashTable< MaterialDoc * > inProgressMaterials
void UnRegisterMaterialView(MaterialView *view)
Tells the MaterialDocManager to stop sending notifications to a view.
Responsible for managing a single material that is being viewed and/or edited.
void AddMaterialUndoModifier(MaterialModifier *mod, bool clearRedo=true)
Adds an undo operation to the undo buffer.
void UnRegisterAllMaterialViews()
Unregisters all of the views that are registered to get material change notifications.
void StageAdded(MaterialDoc *materialDoc, int stageNum)
Called when a stage is added and notifies all views of the addition.
void CopyStage(MaterialDoc *materialDoc, int stageNum)
Prepares a material stage for a copy/paste operation.
void SaveFile(const char *filename)
Saves all materials in the specified file.
idList< MaterialModifier * > redoModifiers
void AddMaterialRedoModifier(MaterialModifier *mod)
Adds a redo operation to the redo buffer.
MaterialDoc * CreateMaterialDoc(const char *materialName)
Creates a MaterialDoc object for the specified material name.
void PasteStage(MaterialDoc *materialDoc)
Performs a paste operation of the stage in the copy buffer.
void ClearUndo()
Clears the entire undo buffer.
void MaterialChanged(MaterialDoc *materialDoc)
Called when a material has been edited and notifies all views of the change.
void SaveMaterial(MaterialDoc *material)
Saves a single material.
void Redo()
Performs the first available redo operation.
void MaterialApplied(MaterialDoc *materialDoc)
Called when a material has been applied and notifies all views of the apply.
MaterialDocManager(void)
Constructor for MaterialDocManager.
void ApplyMaterial(MaterialDoc *materialDoc)
Applys changes to a material.
Structure used to store the user defined search parameters.
void SetSelectedMaterial(idMaterial *material)
Tells the MaterialDocManager which material has been selected for editing.
void PasteMaterial(const char *name, const char *filename)
Performs a material paste operation for a material in the copy buffer.
void AttributeChanged(MaterialDoc *materialDoc, int stage, const char *attribName)
Called when a material attribute has been edited and notifies all views of the change.
void StageMoved(MaterialDoc *materialDoc, int from, int to)
Called when a stage has been movied and notifies all views of the change.
bool IsFileModified(const char *filename)
Returns true if the specified file has been modified.
void ClearRedo()
Clears the redo buffer.
bool DoesAnyNeedApply()
Returns true if any material needs to be applied.
void ReloadFile(const char *filename)
Reloads a specified file.
Responsible for managing the materials that are being viewed and/or edited.
MaterialDoc * currentMaterial
void ApplyFile(const char *filename)
Applies all materials in the specified filename.
void AddMaterial(const char *name, const char *filename, const char *sourceText=NULL, bool addUndo=true)
Adds a material.
bool IsUndoAvailable()
Returns true if an undo operation is available.
void CopyMaterial(MaterialDoc *materialDoc=NULL, bool cut=false)
Prepares a material for a copy/cut and paste operations.
MaterialDoc * GetCurrentMaterialDoc()
bool IsAnyModified()
Returns true if any material has been modified.
void RedoAddMaterial(const char *name, bool clearData=true)
Used to redo an add material and undo a delete material.
Dictionary representation of a Material Stage.
void MaterialNameChanged(const char *oldName, MaterialDoc *materialDoc)
Called when a material name has been changed and notifies all views of the change.
bool FindMaterial(const char *name, MaterialSearchData_t *searchData, bool checkName)
Searches for a material that matches the specified search data.