ISXDK:ISInterface

From Lavish Software Wiki
Jump to: navigation, search

Overview

ISInterface is the interface given to your extension to communicate directly with Inner Space. The functions provided should be sufficient to perform any necessary task. If this is NOT sufficient, please post on our forums requesting whatever features you need.

Interface

.NET 2.0

bool IsAvailable()
bool TryInitialize()
bool RegisterLibrary(const char *Name,fGetAPI)
bool UnregisterLibrary(const char *Name)
bool Execute(const char *Domain, const char *AssemblyName, int argc=0, const char *argv[]=0)
bool UnloadDomain(const char *Name)
unsigned int EnumDomains(fDomainEnumCallback, void *pData)
bool IsDomainActive(const char *Name)

Thread Synchronization

void FrameLock()
void FrameUnlock()
bool FrameTryLock()
void FrameWait(bool bLock)

LavishScript

char *GetCWD(char *buffer, unsigned int buflen)
char *SetRoot(char *Filename, char *Dest)
bool AddCommand(char *Command, fLSCommand Function, bool Parse=true, bool Hidden=false)
bool RemoveCommand(const char *Command)
bool AddAlias(const char *Replace, char *With)
bool RemoveAlias(const char *Replace)
char *GetArgs(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
char *GetArgsQuoted(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
char *GetArgsQuotedNF(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
void ExecuteTimedCommand(unsigned int DelayMS, const char *Command)
int ExecuteCommand(const char *Text)
int DataParse(const char *ToParse, char *buf, int buflen)
bool DataParse(const char *Text, LSOBJECT &Object)
bool RunScript(char *Filename)
bool EndScript(char *Filename)
bool RunCommandFile(const char *Filename)
bool AddTopLevelObject(char *Name, fLSTopLevelObject Function)
bool RemoveTopLevelObject(const char *Name)
bool AddLSTypeDefinition(class LSTypeDefinition &Type)
bool RemoveLSTypeDefinition(class LSTypeDefinition &Type)
LSTypeDefinition *FindLSTypeDefinition(const char *Name, char *subtypebuf=0, unsigned int subtypebuflen=0)
fLS Command IsCommand(const char *Name)
bool IsAlias(char *Name)
bool IsTopLevelObject(const char *Name)
bool IsLSTypeDefinition(const char *Name)
bool ResolveCommand(const char *Text, char *buf,unsigned int buflen)
void *GetTempBuffer(unsigned int Size, void *CopyFrom=0)
void *AddTempObject(const char *Name, const char *Buffer, unsigned int buflen, int argc=0, char *argv[]=0, const char *CWD=0)
bool RunScriptFromBuffer(char *Name, char *Buffer, unsigned int buflen) 

unsigned int PreParseText(const char *Text, bool bDataSequence=false)
bool RetrieveOriginalText(unsigned int ID, char *buf, unsigned int buflen)
bool RetrieveProcessedText(unsigned int ID, char *buf, unsigned int buflen)
bool RetrieveProcessedResult(unsigned int ID, LSOBJECT &Result)
bool FreePreParsed(unsigned int ID)

unsigned int AddGlobalAtom(const char *Buffer, unsigned int buflen)
bool RemoveAtom(unsigned int AtomID)
int ExecuteAtom(unsigned int AtomID,
                int argc=0, 
                char *argv[]=0, 
                PLSOBJECT pThisLSObject=0, 
                PLSOBJECT pContext=0, 
                char *ReturnBuffer=0,
                unsigned int buflen=0)
int ExecuteAtom(const char *Name,
                int argc=0, 
                char *argv[]=0, 
                PLSOBJECT pContext=0, 
                char *ReturnBuffer=0,  
                unsigned int buflen=0)
int ExecuteAtom(const char *ScriptName, 
                const char *Name,
                int argc=0, 
                char *argv[]=0, 
                PLSOBJECT pContext=0, 
                char *ReturnBuffer=0, 
                unsigned int buflen=0)
unsigned int ResolveAtom(const char *Name)

unsigned int EnumAliases(fLSGenericEnumCallback Callback, void *pData)
unsigned int EnumCommands(fLSGenericEnumCallback Callback, void *pData)
unsigned int EnumLSTypeDefinitions(fLSGenericEnumCallback Callback, void *pData)
unsigned int EnumTopLevelObjects(fLSGenericEnumCallback Callback, void *pData)
unsigned int EnumScripts(fLSGenericEnumCallback Callback, void *pData)

bool GetCurrentScript(char *buffer, unsigned int buflen)
bool GetScriptCWD(const char *ScriptName, char *buffer, unsigned int buflen)
bool QueueCommand(const char *ScriptName, const char *Command)
unsigned int GetScriptRuntime(const char *ScriptName)
unsigned int PauseScripts()
unsigned int ResumeScripts()
unsigned int AddAtom(const char *ScriptName, const char *Buffer, unsigned int buflen)
bool ScriptEngineActive()
void LavishScriptPulse()

unsigned int RegisterEvent(const char *Name)
void UnregisterEvent(unsigned int EventID)
bool ExecuteEvent(unsigned int EventID,int BeginInclusive=0, int EndExclusive=0, char *argv[]=0, PLSOBJECT pThisLSObject=0)
bool AttachEventTarget(unsigned int EventID,unsigned int AtomID)
bool AttachEventTarget(unsigned int EventID,fLSEventTarget fCallback)
bool DetachEventTarget(unsigned int EventID,unsigned int AtomID)
bool DetachEventTarget(unsigned int EventID,fLSEventTarget fCallback)

unsigned int GetRuntime()
char *Escape(const char *text, char *buf, int buflen)
char *EscapeQuotes(const char *text, char *buf, int buflen)
bool CalculateResult(const char *Formula, double &Result)
bool CalculateResult(const char *Formula, __int64 &Result)

void Printf(const char *Format, ...)
void Print(const char *Text)
unsigned int GetTerminalWidth()

Service Master

HISXSERVICE RegisterService(ISXInterface *pMaster, const char *Name, fISServiceRequest RequestCallback=0)
bool ServiceBroadcast(ISXInterface *pMaster, HISXSERVICE hService, unsigned int MSG, void *lpData)
bool ServiceNotify(ISXInterface *pMaster, HISXSERVICE hService, ISXInterface *pTarget, unsigned int MSG, void *lpData)
bool ShutdownService(ISXInterface *pMaster, HISXSERVICE hService)

Service Client

HISXSERVICE ConnectService(ISXInterface *pClient, const char *ServiceName, fISService NotifyCallback)
bool ServiceRequest(ISXInterface *pClient, HISXSERVICE hService, unsigned int MSG, void *lpData)
void DisconnectService(ISXInterface *pClient, HISXSERVICE hService)

Input

bool AddHotkey(char *Name, const char *Combo, const char *Command, bool Press=false)
bool IsHotkey(const char *Name)
bool RemoveHotkey(const char *Name)
bool MouseTo(int X, int Y)
bool GetMousePos(int &X, int &Y)

bool EmulateKeyPress(const char *Combo, bool Hold)
bool EmulateKeyRelease(const char *Combo)
bool EmulateTyping(const char *Text)
bool EmulateMousePress(unsigned int Button, bool Hold)
bool EmulateMouseRelease(unsigned int Button)

unsigned int SetPrintableBindsAllowed(bool bEnable)
unsigned int GetPrintableBindsAllowedCount() 

Lavish Settings

unsigned int OpenSettings(const char *Filename)
unsigned int FindFileSet(const char *Filename)
unsigned int FindSet(unsigned int &ParentSetGUID, const char *Name)
bool SaveFileSet(const char *Filename)

bool ExportSet(unsigned int &SetGUID, const char *Filename)
bool ImportToSet(unsigned int &SetGUID, const char *Filename)
bool CopySet(unsigned int &ToSetGUID, unsigned int FromSetGUID)
bool UnloadSet(unsigned int &SetGUID)
bool ClearSet(unsigned int &SetGUID)
bool SortSet(unsigned int &SetGUID)
unsigned int ISInterface:CreateSet(unsigned int &SetGUID, const char *Name)
bool GetSetName(unsigned int &SetGUID, char *buf, unsigned int buflen)
bool GetSetParent(unsigned int &SetGUID, unsigned int &ParentSetGUID)

bool RenameSetting(unsigned int &SetGUID, const char *Setting, const char *NewName)
bool RemoveSetting(unsigned int &SetGUID, const char *Setting)

bool AssertSetting(unsigned int &SetGUID, const char *Setting, const char *Value)
bool AssertSetting(unsigned int &SetGUID, const char *Setting, bool &bValue)
bool AssertSetting(unsigned int &SetGUID, const char *Setting, int iValue)
bool AssertSetting(unsigned int &SetGUID, const char *Setting, float &fValue)
bool AssertSetting(unsigned int &SetGUID, const char *Setting, unsigned int &ulValue)
bool AssertSetting(unsigned int &SetGUID, const char *Setting, __int64 &Value)

bool GetSetting(unsigned int &SetGUID, const char *Setting, char *buf, unsigned int buflen)
bool GetSetting(unsigned int &SetGUID, const char *Setting, bool &bValue)
bool GetSetting(unsigned int &SetGUID, const char *Setting, int &iValue)
bool GetSetting(unsigned int &SetGUID, const char *Setting, float &fValue)
bool GetSetting(unsigned int &SetGUID, const char *Setting, unsigned int &ulValue)
bool GetSetting(unsigned int &SetGUID, const char *Setting, __int64 &Value)

bool SetSetting(unsigned int &SetGUID, const char *Setting, char *Value)
bool SetSetting(unsigned int &SetGUID, const char *Setting, int iValue)
bool SetSetting(unsigned int &SetGUID, const char *Setting, unsigned int &ulValue)
bool SetSetting(unsigned int &SetGUID, const char *Setting, float &fValue)
bool SetSetting(unsigned int &SetGUID, const char *Setting, __int64 &Value)

bool CreateComment(unsigned int &SetGUID, const char *Text)

unsigned int EnumSets(unsigned int &SetGUID, fSetEnumCallback Callback, void *pData)
unsigned int EnumSettings(unsigned int &SetGUID, fSettingEnumCallback Callback, void *pData)

Navigation

unsigned int LNavAddRegion(unsigned int ParentGUID, const char *Type, const char *Name, int BeginInclusive, int EndExclusive, char *argv[])
bool ISInterface:LNavRemoveRegion(unsigned int RegionGUID)

unsigned int ISInterface:LNavAddConnection(unsigned int FromGUID, unsigned int ToGUID, int BeginInclusive, int EndExclusive, char *argv[])
bool ISInterface:LNavRemoveConnection(unsigned int ConnectionGUID)

unsigned int LNavResolveFQN(const char *FQN, unsigned int FromGUID=0)

bool NavigationLoadXML(char *Filename)
bool NavigationDumpXML(char *Filename)

IPC

void Relay(const char *Session, const char *Command)
unsigned int GetSessionCount()
bool GetSessionName(unsigned int nSession, char *buf, int buflen)

Display

bool GetDisplaySize(unsigned int &Height, unsigned int &Width)
bool GetPixel(int X, int Y, RGBCOLOR &Color)
bool GetPixels(int X, int Y, unsigned int nRows, unsigned int nColumns, RGBCOLOR **Rows)

Misc

unsigned int GetVersion()
unsigned int GetBuildNumber()

unsigned int GetExtensionSetGuid(const char *Extension)
unsigned int GetScriptSetGUID(const char *Script)
unsigned int CreateExtensionSet(const char *Extension)
unsigned int CreateScriptSet(const char *Script)

unsigned int GetGameSetGUID()
unsigned int GetProfileSetGUID()
bool LoadExtension(const char *Filename)
bool UnloadExtension(char *Filename)
bool IsExtensionLoaded(char *Filename)

bool HighStealthEnabled()
void EnableHighStealth()
void DisableHighStealthy()

char *GetInnerSpacePath(char *buffer, unsigned int buflen)
bool AddElement(const char *Name, const char *Data, int X, int Y, unsigned int Color, const char *Group="Default")
bool RemoveElement(const char *Name)
void ClearConsole()

See Also