winamp/Src/Wasabi/api/script/api_maki.h

393 lines
13 KiB
C
Raw Normal View History

2024-09-24 12:54:57 +00:00
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Fri Oct 01 02:49:40 1999]
//
// File : api_maki.h
// Class : api_maki
// class layer : Dispatchable Interface
// ----------------------------------------------------------------------------
#ifndef __API_MAKI_H
#define __API_MAKI_H
#include <bfc/dispatch.h>
class ScriptObject;
class ScriptObjectController;
#include <api/script/scriptvar.h>
#include <api/script/vcputypes.h>
// ----------------------------------------------------------------------------
class NOVTABLE api_maki: public Dispatchable {
protected:
api_maki() {}
~api_maki() {}
public:
void maki_pushObject(void *o);
void maki_pushInt(int i);
void maki_pushBoolean(int b);
void maki_pushFloat(float f);
void maki_pushDouble(double d);
void maki_pushString(const wchar_t *s);
void maki_pushVoid();
void maki_pushAny(scriptVar v);
void *maki_popObject();
int maki_popInt();
bool maki_popBoolean();
float maki_popFloat();
double maki_popDouble();
const wchar_t *maki_popString();
scriptVar maki_popAny();
void maki_popDiscard();
const wchar_t *maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p);
int maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host);
void maki_addDlfClassRef(ScriptObjectController *o, void *host);
void maki_remDlfRef(void *host);
scriptVar maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params);
scriptVar maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid = -1);
int maki_getScriptInt(scriptVar v);
bool maki_getScriptBoolean(scriptVar v);
float maki_getScriptFloat(scriptVar v);
double maki_getScriptDouble(scriptVar v);
const wchar_t *maki_getScriptString(scriptVar v);
ScriptObject *maki_getScriptObject(scriptVar v);
scriptVar maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount);
ScriptObject *maki_instantiate(GUID classguid);
void maki_destroy(ScriptObject *o);
void *maki_encapsulate(GUID classguid, ScriptObject *o);
void maki_deencapsulate(GUID classguid, void *o);
ScriptObjectController *maki_getController(GUID scriptclass);
int maki_createOrphan(int type);
void maki_killOrphan(int id);
void maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object);
ScriptObject *maki_getObjectAtom(const wchar_t *atomname);
#ifdef WASABI_COMPILE_WND
ScriptObject *maki_findObject(const wchar_t *name);
#endif
void vcpu_addScriptObject(ScriptObject *o);
void vcpu_removeScriptObject(ScriptObject *o);
int vcpu_getCacheCount();
int vcpu_isValidScriptId(int id);
int vcpu_mapVarId(int varid, int scriptid);
int vcpu_getUserAncestorId(int varid, int scriptid);
int vcpu_getNumEvents();
int vcpu_getEvent(int event, int *dlf, int *script, int *var);
int vcpu_getComplete();
void vcpu_setComplete();
void vcpu_resetComplete();
const wchar_t *vcpu_getClassName(int vcpuid, int localclassid);
protected:
enum {
API_MAKI_MAKI_PUSHOBJECT = 10,
API_MAKI_MAKI_PUSHINT = 20,
API_MAKI_MAKI_PUSHBOOLEAN = 30,
API_MAKI_MAKI_PUSHFLOAT = 40,
API_MAKI_MAKI_PUSHDOUBLE = 50,
API_MAKI_MAKI_PUSHSTRING = 60,
API_MAKI_MAKI_PUSHVOID = 70,
API_MAKI_MAKI_PUSHANY = 80,
API_MAKI_MAKI_POPOBJECT = 90,
API_MAKI_MAKI_POPINT = 100,
API_MAKI_MAKI_POPBOOLEAN = 110,
API_MAKI_MAKI_POPFLOAT = 120,
API_MAKI_MAKI_POPDOUBLE = 130,
API_MAKI_MAKI_POPSTRING = 140,
API_MAKI_MAKI_POPANY = 150,
API_MAKI_MAKI_POPDISCARD = 160,
API_MAKI_MAKI_GETFUNCTION = 170,
API_MAKI_MAKI_ADDDLFREF = 180,
API_MAKI_MAKI_ADDDLFCLASSREF = 190,
API_MAKI_MAKI_REMDLFREF = 200,
API_MAKI_MAKI_CALLFUNCTION = 210,
API_MAKI_MAKI_TRIGGEREVENT = 220,
API_MAKI_MAKI_GETSCRIPTINT = 230,
API_MAKI_MAKI_GETSCRIPTBOOLEAN = 240,
API_MAKI_MAKI_GETSCRIPTFLOAT = 250,
API_MAKI_MAKI_GETSCRIPTDOUBLE = 260,
API_MAKI_MAKI_GETSCRIPTSTRING = 270,
API_MAKI_MAKI_GETSCRIPTOBJECT = 280,
API_MAKI_MAKI_UPDATEDLF = 290,
API_MAKI_MAKI_INSTANTIATE = 300,
API_MAKI_MAKI_DESTROY = 310,
API_MAKI_MAKI_ENCAPSULATE = 320,
API_MAKI_MAKI_DEENCAPSULATE = 330,
API_MAKI_MAKI_GETCONTROLLER = 340,
API_MAKI_MAKI_CREATEORPHAN = 350,
API_MAKI_MAKI_KILLORPHAN = 360,
API_MAKI_MAKI_SETOBJECTATOM = 370,
API_MAKI_MAKI_GETOBJECTATOM = 380,
#ifdef WASABI_COMPILE_WND
API_MAKI_MAKI_FINDOBJECT = 390,
#endif
API_MAKI_VCPU_ADDSCRIPTOBJECT = 400,
API_MAKI_VCPU_REMOVESCRIPTOBJECT = 410,
API_MAKI_VCPU_GETCACHECOUNT = 420,
API_MAKI_VCPU_ISVALIDSCRIPTID = 430,
API_MAKI_VCPU_MAPVARID = 440,
API_MAKI_VCPU_GETUSERANCESTORID = 450,
API_MAKI_VCPU_GETNUMEVENTS = 460,
API_MAKI_VCPU_GETEVENT = 470,
API_MAKI_VCPU_GETCOMPLETE = 480,
API_MAKI_VCPU_SETCOMPLETE = 481,
API_MAKI_VCPU_RESETCOMPLETE = 482,
API_MAKI_VCPU_GETCLASSNAME = 490,
};
};
// ----------------------------------------------------------------------------
inline void api_maki::maki_pushObject(void *o) {
_voidcall(API_MAKI_MAKI_PUSHOBJECT, o);
}
inline void api_maki::maki_pushInt(int i) {
_voidcall(API_MAKI_MAKI_PUSHINT, i);
}
inline void api_maki::maki_pushBoolean(int b) {
_voidcall(API_MAKI_MAKI_PUSHBOOLEAN, b);
}
inline void api_maki::maki_pushFloat(float f) {
_voidcall(API_MAKI_MAKI_PUSHFLOAT, f);
}
inline void api_maki::maki_pushDouble(double d) {
_voidcall(API_MAKI_MAKI_PUSHDOUBLE, d);
}
inline void api_maki::maki_pushString(const wchar_t *s) {
_voidcall(API_MAKI_MAKI_PUSHSTRING, s);
}
inline void api_maki::maki_pushVoid() {
_voidcall(API_MAKI_MAKI_PUSHVOID);
}
inline void api_maki::maki_pushAny(scriptVar v) {
_voidcall(API_MAKI_MAKI_PUSHANY, v);
}
inline void *api_maki::maki_popObject() {
void *__retval = _call(API_MAKI_MAKI_POPOBJECT, (void *)NULL);
return __retval;
}
inline int api_maki::maki_popInt() {
int __retval = _call(API_MAKI_MAKI_POPINT, (int)0);
return __retval;
}
inline bool api_maki::maki_popBoolean() {
bool __retval = _call(API_MAKI_MAKI_POPBOOLEAN, (bool)0);
return __retval;
}
inline float api_maki::maki_popFloat() {
float __retval = _call(API_MAKI_MAKI_POPFLOAT, (float)0);
return __retval;
}
inline double api_maki::maki_popDouble() {
double __retval = _call(API_MAKI_MAKI_POPDOUBLE, (double)0);
return __retval;
}
inline const wchar_t *api_maki::maki_popString() {
return _call(API_MAKI_MAKI_POPSTRING, (const wchar_t *)0);
}
inline scriptVar api_maki::maki_popAny()
{
scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
scriptVar __retval = _call(API_MAKI_MAKI_POPANY, (scriptVar)r);
return __retval;
}
inline void api_maki::maki_popDiscard() {
_voidcall(API_MAKI_MAKI_POPDISCARD);
}
inline const wchar_t *api_maki::maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p) {
return _call(API_MAKI_MAKI_GETFUNCTION, (const wchar_t *)0, dlfid, nparams, p);
}
inline int api_maki::maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host) {
int __retval = _call(API_MAKI_MAKI_ADDDLFREF, (int)0, o, function_name, host);
return __retval;
}
inline void api_maki::maki_addDlfClassRef(ScriptObjectController *o, void *host) {
_voidcall(API_MAKI_MAKI_ADDDLFCLASSREF, o, host);
}
inline void api_maki::maki_remDlfRef(void *host) {
_voidcall(API_MAKI_MAKI_REMDLFREF, host);
}
inline scriptVar api_maki::maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params) {
scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
scriptVar __retval = _call(API_MAKI_MAKI_CALLFUNCTION, (scriptVar)r, o, dlfid, params);
return __retval;
}
inline scriptVar api_maki::maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid) {
scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
scriptVar __retval = _call(API_MAKI_MAKI_TRIGGEREVENT, (scriptVar)r, o, dlfid, np, scriptid);
return __retval;
}
inline int api_maki::maki_getScriptInt(scriptVar v) {
int __retval = _call(API_MAKI_MAKI_GETSCRIPTINT, (int)0, v);
return __retval;
}
inline bool api_maki::maki_getScriptBoolean(scriptVar v) {
bool __retval = _call(API_MAKI_MAKI_GETSCRIPTBOOLEAN, (bool)0, v);
return __retval;
}
inline float api_maki::maki_getScriptFloat(scriptVar v) {
float __retval = _call(API_MAKI_MAKI_GETSCRIPTFLOAT, (float)0, v);
return __retval;
}
inline double api_maki::maki_getScriptDouble(scriptVar v) {
double __retval = _call(API_MAKI_MAKI_GETSCRIPTDOUBLE, (double)0, v);
return __retval;
}
inline const wchar_t *api_maki::maki_getScriptString(scriptVar v) {
const wchar_t *__retval = _call(API_MAKI_MAKI_GETSCRIPTSTRING, (const wchar_t *)0, v);
return __retval;
}
inline ScriptObject *api_maki::maki_getScriptObject(scriptVar v) {
ScriptObject *__retval = _call(API_MAKI_MAKI_GETSCRIPTOBJECT, (ScriptObject *)NULL, v);
return __retval;
}
inline scriptVar api_maki::maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount) {
scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
scriptVar __retval = _call(API_MAKI_MAKI_UPDATEDLF, (scriptVar)r, cmd, dlfid, linkcount);
return __retval;
}
inline ScriptObject *api_maki::maki_instantiate(GUID classguid) {
ScriptObject *__retval = _call(API_MAKI_MAKI_INSTANTIATE, (ScriptObject *)NULL, classguid);
return __retval;
}
inline void api_maki::maki_destroy(ScriptObject *o) {
_voidcall(API_MAKI_MAKI_DESTROY, o);
}
inline void *api_maki::maki_encapsulate(GUID classguid, ScriptObject *o) {
void *__retval = _call(API_MAKI_MAKI_ENCAPSULATE, (void *)NULL, classguid, o);
return __retval;
}
inline void api_maki::maki_deencapsulate(GUID classguid, void *o) {
_voidcall(API_MAKI_MAKI_DEENCAPSULATE, classguid, o);
}
inline ScriptObjectController *api_maki::maki_getController(GUID scriptclass) {
ScriptObjectController *__retval = _call(API_MAKI_MAKI_GETCONTROLLER, (ScriptObjectController *)NULL, scriptclass);
return __retval;
}
inline int api_maki::maki_createOrphan(int type) {
int __retval = _call(API_MAKI_MAKI_CREATEORPHAN, (int)0, type);
return __retval;
}
inline void api_maki::maki_killOrphan(int id) {
_voidcall(API_MAKI_MAKI_KILLORPHAN, id);
}
inline void api_maki::maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object) {
_voidcall(API_MAKI_MAKI_SETOBJECTATOM, atomname, object);
}
inline ScriptObject *api_maki::maki_getObjectAtom(const wchar_t *atomname) {
ScriptObject *__retval = _call(API_MAKI_MAKI_GETOBJECTATOM, (ScriptObject *)NULL, atomname);
return __retval;
}
#ifdef WASABI_COMPILE_WND
inline ScriptObject *api_maki::maki_findObject(const wchar_t *name) {
ScriptObject *__retval = _call(API_MAKI_MAKI_FINDOBJECT, (ScriptObject *)NULL, name);
return __retval;
}
#endif
inline void api_maki::vcpu_addScriptObject(ScriptObject *o) {
_voidcall(API_MAKI_VCPU_ADDSCRIPTOBJECT, o);
}
inline void api_maki::vcpu_removeScriptObject(ScriptObject *o) {
_voidcall(API_MAKI_VCPU_REMOVESCRIPTOBJECT, o);
}
inline int api_maki::vcpu_getCacheCount() {
int __retval = _call(API_MAKI_VCPU_GETCACHECOUNT, (int)0);
return __retval;
}
inline int api_maki::vcpu_isValidScriptId(int id) {
int __retval = _call(API_MAKI_VCPU_ISVALIDSCRIPTID, (int)0, id);
return __retval;
}
inline int api_maki::vcpu_mapVarId(int varid, int scriptid) {
int __retval = _call(API_MAKI_VCPU_MAPVARID, (int)0, varid, scriptid);
return __retval;
}
inline int api_maki::vcpu_getUserAncestorId(int varid, int scriptid) {
int __retval = _call(API_MAKI_VCPU_GETUSERANCESTORID, (int)0, varid, scriptid);
return __retval;
}
inline int api_maki::vcpu_getNumEvents() {
int __retval = _call(API_MAKI_VCPU_GETNUMEVENTS, (int)0);
return __retval;
}
inline int api_maki::vcpu_getEvent(int event, int *dlf, int *script, int *var) {
int __retval = _call(API_MAKI_VCPU_GETEVENT, (int)0, event, dlf, script, var);
return __retval;
}
inline int api_maki::vcpu_getComplete() {
int __retval = _call(API_MAKI_VCPU_GETCOMPLETE, (int)0);
return __retval;
}
inline void api_maki::vcpu_setComplete() {
_voidcall(API_MAKI_VCPU_SETCOMPLETE);
}
inline void api_maki::vcpu_resetComplete() {
_voidcall(API_MAKI_VCPU_RESETCOMPLETE);
}
inline const wchar_t *api_maki::vcpu_getClassName(int vcpuid, int localclassid) {
return _call(API_MAKI_VCPU_GETCLASSNAME, (const wchar_t *)0, vcpuid, localclassid);
}
// ----------------------------------------------------------------------------
// {87D2391B-C928-4a49-8E0B-D47C049E0711}
static const GUID makiApiServiceGuid =
{ 0x87d2391b, 0xc928, 0x4a49, { 0x8e, 0xb, 0xd4, 0x7c, 0x4, 0x9e, 0x7, 0x11 } };
extern api_maki *makiApi;
#endif // __API_MAKI_H