Documentation / Testing updates

This commit is contained in:
Unknown
2018-06-12 16:37:41 -04:00
parent a3d1781557
commit 47f24275b1
11 changed files with 906 additions and 855 deletions

View File

@@ -8,33 +8,45 @@ import "fmt"
// Document.Dump(). ModeEnum tells the program how trustworthy that file is.
type ModeEnum int
// Holds the current mode.
// Mode holds the current mode.
var Mode ModeEnum
// Fast mode skips all verification. Use Fast mode only when certain that the
// .psd file hasn't changed since the last time Document.Dump() was called.
const Fast ModeEnum = 2
const (
// Normal Mode only verifies layers as they are operated on. The first time a
// layer's properties would be checked, it first overwrites the data from the
// Dump with data pulled directly from Photoshop. This allows you to quickly
// load documents in their current form.
Normal ModeEnum = iota
// Normal Mode only verifies layers as they are operated on. The first time a
// layer's properties would be checked, it first overwrites the data from the
// Dump with data pulled directly from Photoshop. This allows you to quickly
// load documents in their current form.
const Normal ModeEnum = 0
// Safe Mode always loads the document from scratch, ignoring any dumped data.
// (Very Slow). If a function panics due to outdated data, often times re-running
// the function in safe mode is enough to remediate it.
Safe
// Safe Mode always loads the document from scratch, ignoring any dumped data.
// (Very Slow). If a function panics due to outdated data, often times re-running
// the function in safe mode is enough to re-mediate it.
const Safe ModeEnum = 1
// Fast mode skips all verification. Use Fast mode only when certain that the
// .psd file hasn't changed since the last time Document.Dump() was called.
Fast
)
// PSSaveOptions is an enum for options when closing a document.
type PSSaveOptions int
// const Fast ModeEnum = 2
func (p *PSSaveOptions) String() string {
return fmt.Sprint("", *p)
// const Normal ModeEnum = 0
// const Safe ModeEnum = 1
// SaveOption is an enum for options when closing a document.
type SaveOption int
func (p *SaveOption) String() string {
return fmt.Sprint("", *p) // TODO: Fix
}
const (
PSSaveChanges PSSaveOptions = iota + 1 // Saves changes before closing documents.
PSDoNotSaveChanges // Closes documents without saving.
PSPromptToSaveChanges // Prompts whether to save before closing.
)
// SaveChanges Saves changes before closing documents.
const SaveChanges SaveOption = 1
// DoNotSaveChanges Closes documents without saving.
const DoNotSaveChanges SaveOption = 2
// PromptToSaveChanges prompts the user whether the file
// should be saved before closing.
const PromptToSaveChanges SaveOption = 3