Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
12
Src/Wasabi/api/script/api_maki.cpp
Normal file
12
Src/Wasabi/api/script/api_maki.cpp
Normal file
|
@ -0,0 +1,12 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Generated by InterfaceFactory [Fri Oct 01 02:49:40 1999]
|
||||
//
|
||||
// File : api_maki.cpp
|
||||
// Class : api_maki
|
||||
// class layer : Dispatchable Interface
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include <precomp.h>
|
||||
#include "api_maki.h"
|
||||
|
||||
|
392
Src/Wasabi/api/script/api_maki.h
Normal file
392
Src/Wasabi/api/script/api_maki.h
Normal file
|
@ -0,0 +1,392 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// 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
|
20
Src/Wasabi/api/script/api_makidebug.cpp
Normal file
20
Src/Wasabi/api/script/api_makidebug.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "precomp.h"
|
||||
#include "api_makidebug.h"
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
#define CBCLASS api_makiDebuggerI
|
||||
START_DISPATCH;
|
||||
VCB(API_MAKIDEBUGGER_DEBUGGER_TRACE, debugger_trace);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_ISACTIVE, debugger_isActive);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVIP, debugger_getVIP);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVSD, debugger_getVSD);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVCC, debugger_getVCC);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVSP, debugger_getVSP);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_FILTEREVENT, debugger_filterEvent);
|
||||
VCB(API_MAKIDEBUGGER_DEBUGGER_EVENTCOMPLETE, debugger_eventComplete);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_CREATEJITD, debugger_createJITD);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_READSTACK, debugger_readStack);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETCODEBLOCK, debugger_getCodeBlock);
|
||||
END_DISPATCH;
|
134
Src/Wasabi/api/script/api_makidebug.h
Normal file
134
Src/Wasabi/api/script/api_makidebug.h
Normal file
|
@ -0,0 +1,134 @@
|
|||
#ifndef __API_MAKIDEBUG_H
|
||||
#define __API_MAKIDEBUG_H
|
||||
|
||||
/*---------------------------------------------------------
|
||||
api_makiDebugger
|
||||
void debugger_trace();
|
||||
int debugger_isActive();
|
||||
int debugger_getVIP();
|
||||
int debugger_getVSD();
|
||||
int debugger_getVCC();
|
||||
int debugger_getVSP();
|
||||
int debugger_filterEvent(int vcpuid, int eventid);
|
||||
void debugger_eventComplete();
|
||||
MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1);
|
||||
int debugger_readStack(int n);
|
||||
int debugger_getCodeBlock(int vcpuid);
|
||||
---------------------------------------------------------*/
|
||||
|
||||
#include <wasabicfg.h>
|
||||
|
||||
#ifndef WASABI_COMPILE_SCRIPT
|
||||
#error "This module requires the script api"
|
||||
#endif
|
||||
|
||||
#ifndef WASABI_COMPILE_MAKIDEBUG
|
||||
#error "This module requires the script debugger api"
|
||||
#endif
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <api/script/scriptvar.h>
|
||||
|
||||
class MakiJITD;
|
||||
|
||||
class NOVTABLE api_makiDebugger : public Dispatchable {
|
||||
public:
|
||||
void debugger_trace();
|
||||
int debugger_isActive();
|
||||
int debugger_getVIP();
|
||||
int debugger_getVSD();
|
||||
int debugger_getVCC();
|
||||
int debugger_getVSP();
|
||||
int debugger_filterEvent(int vcpuid, int eventid);
|
||||
void debugger_eventComplete();
|
||||
MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1);
|
||||
scriptVar debugger_readStack(int n);
|
||||
const char *debugger_getCodeBlock(int vcpuid);
|
||||
|
||||
enum {
|
||||
API_MAKIDEBUGGER_DEBUGGER_TRACE = 0,
|
||||
API_MAKIDEBUGGER_DEBUGGER_ISACTIVE = 10,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVIP = 20,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVSD = 30,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVCC = 40,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVSP = 50,
|
||||
API_MAKIDEBUGGER_DEBUGGER_FILTEREVENT = 60,
|
||||
API_MAKIDEBUGGER_DEBUGGER_EVENTCOMPLETE = 70,
|
||||
API_MAKIDEBUGGER_DEBUGGER_CREATEJITD = 80,
|
||||
API_MAKIDEBUGGER_DEBUGGER_READSTACK = 90,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETCODEBLOCK = 100,
|
||||
};
|
||||
};
|
||||
|
||||
inline void api_makiDebugger::debugger_trace() {
|
||||
_voidcall(API_MAKIDEBUGGER_DEBUGGER_TRACE);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_isActive() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_ISACTIVE, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVIP() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVIP, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVSD() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVSD, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVCC() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVCC, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVSP() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVSP, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_filterEvent(int vcpuid, int eventid) {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_FILTEREVENT, (int)0, vcpuid, eventid);
|
||||
}
|
||||
|
||||
inline void api_makiDebugger::debugger_eventComplete() {
|
||||
_voidcall(API_MAKIDEBUGGER_DEBUGGER_EVENTCOMPLETE);
|
||||
}
|
||||
|
||||
inline MakiJITD *api_makiDebugger::debugger_createJITD(int vcpuid, int bringitup) {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_CREATEJITD, (MakiJITD *)NULL, vcpuid, bringitup);
|
||||
}
|
||||
|
||||
inline const char *api_makiDebugger::debugger_getCodeBlock(int vcpuid) {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETCODEBLOCK, (const char *)NULL, vcpuid);
|
||||
}
|
||||
|
||||
inline scriptVar api_makiDebugger::debugger_readStack(int n) {
|
||||
scriptVar v={0,0};
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_READSTACK, v, n);
|
||||
}
|
||||
|
||||
class api_makiDebuggerI : public api_makiDebugger {
|
||||
public:
|
||||
virtual void debugger_trace()=0;
|
||||
virtual int debugger_isActive()=0;
|
||||
virtual int debugger_getVIP()=0;
|
||||
virtual int debugger_getVSD()=0;
|
||||
virtual int debugger_getVCC()=0;
|
||||
virtual int debugger_getVSP()=0;
|
||||
virtual int debugger_filterEvent(int vcpuid, int eventid)=0;
|
||||
virtual void debugger_eventComplete()=0;
|
||||
virtual MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1)=0;
|
||||
virtual scriptVar debugger_readStack(int n)=0;
|
||||
virtual const char *debugger_getCodeBlock(int vcpuid)=0;
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
// {858E4B64-AF1E-4b64-8D27-EFFAD9F82BB4}
|
||||
static const GUID makiDebugApiServiceGuid =
|
||||
{ 0x858e4b64, 0xaf1e, 0x4b64, { 0x8d, 0x27, 0xef, 0xfa, 0xd9, 0xf8, 0x2b, 0xb4 } };
|
||||
|
||||
extern api_makiDebugger *debugApi;
|
||||
|
||||
#endif
|
||||
|
||||
|
264
Src/Wasabi/api/script/api_makii.cpp
Normal file
264
Src/Wasabi/api/script/api_makii.cpp
Normal file
|
@ -0,0 +1,264 @@
|
|||
#include <precomp.h>
|
||||
#include "api_makii.h"
|
||||
|
||||
#include <api/script/vcpu.h>
|
||||
#include <api/script/objecttable.h>
|
||||
#include <api/script/scriptmgr.h>
|
||||
#include <api/script/script.h>
|
||||
#include <api/script/scriptobj.h>
|
||||
|
||||
api_maki *makiApi = NULL;
|
||||
|
||||
api_makiI::api_makiI() {
|
||||
VCPU::scriptManager = new ScriptObjectManager();
|
||||
}
|
||||
|
||||
api_makiI::~api_makiI() {
|
||||
delete VCPU::scriptManager;
|
||||
VCPU::scriptManager = NULL;
|
||||
VCPU::shutdown();
|
||||
ObjectTable::unloadExternalClasses();
|
||||
}
|
||||
|
||||
void api_makiI::init() {
|
||||
ObjectTable::loadExternalClasses();
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushObject(void *o) {
|
||||
VCPU::pushObject(o);
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushInt(int i) {
|
||||
VCPU::pushInt(i);
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushBoolean(int b) {
|
||||
VCPU::pushBoolean(b);
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushFloat(float f) {
|
||||
VCPU::pushFloat(f);
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushDouble(double d) {
|
||||
VCPU::pushDouble(d);
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushString(const wchar_t *s) {
|
||||
VCPU::pushString(s);
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushVoid() {
|
||||
VCPU::pushVoid();
|
||||
}
|
||||
|
||||
void api_makiI::maki_pushAny(scriptVar v) {
|
||||
VCPU::push(v);
|
||||
}
|
||||
|
||||
void *api_makiI::maki_popObject() {
|
||||
return VCPU::popObject();
|
||||
}
|
||||
|
||||
int api_makiI::maki_popInt() {
|
||||
return VCPU::popInt();
|
||||
}
|
||||
|
||||
bool api_makiI::maki_popBoolean() {
|
||||
return VCPU::popBoolean();
|
||||
}
|
||||
|
||||
float api_makiI::maki_popFloat() {
|
||||
return VCPU::popFloat();
|
||||
}
|
||||
|
||||
double api_makiI::maki_popDouble() {
|
||||
return VCPU::popDouble();
|
||||
}
|
||||
|
||||
const wchar_t *api_makiI::maki_popString() {
|
||||
return VCPU::popString();
|
||||
}
|
||||
|
||||
scriptVar api_makiI::maki_popAny() {
|
||||
return VCPU::pop().v;
|
||||
}
|
||||
|
||||
void api_makiI::maki_popDiscard() {
|
||||
VCPU::popDiscard();
|
||||
}
|
||||
|
||||
const wchar_t *api_makiI::maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p) {
|
||||
return ObjectTable::getFunction(dlfid, nparams, p);
|
||||
}
|
||||
|
||||
int api_makiI::maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host) {
|
||||
return ObjectTable::dlfAddRef(o, function_name, host);
|
||||
}
|
||||
|
||||
void api_makiI::maki_addDlfClassRef(ScriptObjectController *o, void *host) {
|
||||
ObjectTable::dlfAddClassRef(o, host);
|
||||
}
|
||||
|
||||
void api_makiI::maki_remDlfRef(void *host) {
|
||||
ObjectTable::dlfRemRef(host);
|
||||
}
|
||||
|
||||
scriptVar api_makiI::maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params) {
|
||||
return ObjectTable::callFunction(o, dlfid, params);
|
||||
}
|
||||
|
||||
scriptVar api_makiI::maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid) {
|
||||
scriptVar v = MAKE_SCRIPT_OBJECT(o);
|
||||
return VCPU::executeEvent(v, dlfid, np, scriptid);
|
||||
}
|
||||
|
||||
int api_makiI::maki_getScriptInt(scriptVar v) {
|
||||
return SOM::makeInt(&v);
|
||||
}
|
||||
|
||||
bool api_makiI::maki_getScriptBoolean(scriptVar v) {
|
||||
return SOM::makeBoolean(&v);
|
||||
}
|
||||
|
||||
float api_makiI::maki_getScriptFloat(scriptVar v) {
|
||||
return SOM::makeFloat(&v);
|
||||
}
|
||||
|
||||
double api_makiI::maki_getScriptDouble(scriptVar v) {
|
||||
return SOM::makeDouble(&v);
|
||||
}
|
||||
|
||||
const wchar_t *api_makiI::maki_getScriptString(scriptVar v)
|
||||
{
|
||||
ASSERT(v.type == SCRIPT_STRING);
|
||||
return v.data.sdata;
|
||||
}
|
||||
|
||||
ScriptObject *api_makiI::maki_getScriptObject(scriptVar v) {
|
||||
ASSERT(!SOM::isNumeric(&v) && v.type != SCRIPT_STRING);
|
||||
return v.data.odata;
|
||||
}
|
||||
|
||||
scriptVar api_makiI::maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount) {
|
||||
switch (cmd->cmd) {
|
||||
case MAKI_CMD_ADDREF:
|
||||
(*linkcount)++;
|
||||
break;
|
||||
case MAKI_CMD_REMREF:
|
||||
(*linkcount)--;
|
||||
ASSERT(*linkcount >= 0);
|
||||
if (*linkcount == 0)
|
||||
*dlfid = -1;
|
||||
break;
|
||||
case MAKI_CMD_SETDLF:
|
||||
ASSERT(*dlfid == -1);
|
||||
*dlfid = cmd->id;
|
||||
break;
|
||||
case MAKI_CMD_GETDLF:
|
||||
cmd->id = *dlfid;
|
||||
break;
|
||||
case MAKI_CMD_RESETDLF:
|
||||
*dlfid = -1;
|
||||
break;
|
||||
}
|
||||
RETURN_SCRIPT_VOID
|
||||
}
|
||||
|
||||
ScriptObject *api_makiI::maki_instantiate(GUID classguid) {
|
||||
int classid = ObjectTable::getClassFromGuid(classguid);
|
||||
if (classid == -1) return NULL;
|
||||
return ObjectTable::instantiate(classid);
|
||||
}
|
||||
|
||||
void api_makiI::maki_destroy(ScriptObject *o) {
|
||||
ObjectTable::destroy(o);
|
||||
}
|
||||
|
||||
void *api_makiI::maki_encapsulate(GUID classguid, ScriptObject *o) {
|
||||
int classid = ObjectTable::getClassFromGuid(classguid);
|
||||
if (classid == -1) return NULL;
|
||||
return ObjectTable::encapsulate(classid, o);
|
||||
}
|
||||
|
||||
void api_makiI::maki_deencapsulate(GUID classguid, void *o) {
|
||||
int classid = ObjectTable::getClassFromGuid(classguid);
|
||||
if (classid == -1) return;
|
||||
ObjectTable::deencapsulate(classid, o);
|
||||
}
|
||||
|
||||
ScriptObjectController *api_makiI::maki_getController(GUID scriptclass) {
|
||||
return ObjectTable::getController(scriptclass);
|
||||
}
|
||||
|
||||
int api_makiI::maki_createOrphan(int type) {
|
||||
return VCPU::createOrphan(type);
|
||||
}
|
||||
|
||||
void api_makiI::maki_killOrphan(int id) {
|
||||
VCPU::killOrphan(id);
|
||||
}
|
||||
|
||||
void api_makiI::maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object) {
|
||||
VCPU::setAtom(atomname, object);
|
||||
}
|
||||
|
||||
ScriptObject *api_makiI::maki_getObjectAtom(const wchar_t *atomname) {
|
||||
return VCPU::getAtom(atomname);
|
||||
}
|
||||
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
ScriptObject *api_makiI::maki_findObject(const wchar_t *name)
|
||||
{
|
||||
return ScriptObjectManager::findObject(name);
|
||||
}
|
||||
#endif
|
||||
|
||||
void api_makiI::vcpu_addScriptObject(ScriptObject *o) {
|
||||
SystemObject::addScriptObject(o);
|
||||
}
|
||||
|
||||
void api_makiI::vcpu_removeScriptObject(ScriptObject *o) {
|
||||
SystemObject::removeScriptObject(o);
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_getCacheCount() {
|
||||
return Script::getCacheCount();
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_isValidScriptId(int id) {
|
||||
return Script::isValidScriptId(id);
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_mapVarId(int varid, int scriptid) {
|
||||
return Script::varIdToGlobal(varid, scriptid);
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_getUserAncestorId(int varid, int scriptid) {
|
||||
return Script::getUserAncestor(varid, scriptid);
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_getNumEvents() {
|
||||
return Script::getNumEventsLinked();
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_getEvent(int event, int *dlf, int *script, int *var) {
|
||||
return Script::getLinkedEventParams(event, dlf, script, var);
|
||||
}
|
||||
|
||||
int api_makiI::vcpu_getComplete() {
|
||||
return VCPU::getComplete();
|
||||
}
|
||||
|
||||
void api_makiI::vcpu_setComplete() {
|
||||
VCPU::setComplete();
|
||||
}
|
||||
|
||||
void api_makiI::vcpu_resetComplete() {
|
||||
VCPU::resetComplete();
|
||||
}
|
||||
|
||||
const wchar_t *api_makiI::vcpu_getClassName(int vcpuid, int localclassid) {
|
||||
return VCPU::getClassName(vcpuid, localclassid);
|
||||
}
|
||||
|
93
Src/Wasabi/api/script/api_makii.h
Normal file
93
Src/Wasabi/api/script/api_makii.h
Normal file
|
@ -0,0 +1,93 @@
|
|||
#ifndef _API_MAKII_H
|
||||
#define _API_MAKII_H
|
||||
|
||||
/*[interface.header.h]
|
||||
#include "common/script/scriptvar.h"
|
||||
#include "common/script/vcputypes.h"
|
||||
#include "common/script/objcontroller.h"
|
||||
*/
|
||||
|
||||
#include "api_maki.h"
|
||||
#include "api_makix.h"
|
||||
|
||||
class ScriptObject;
|
||||
class ScriptObjectController;
|
||||
|
||||
class api_makiI : public api_makiX {
|
||||
public:
|
||||
api_makiI();
|
||||
virtual ~api_makiI();
|
||||
DISPATCH(10) virtual void maki_pushObject(void *o);
|
||||
DISPATCH(20) virtual void maki_pushInt(int i);
|
||||
DISPATCH(30) virtual void maki_pushBoolean(int b);
|
||||
DISPATCH(40) virtual void maki_pushFloat(float f);
|
||||
DISPATCH(50) virtual void maki_pushDouble(double d);
|
||||
DISPATCH(60) virtual void maki_pushString(const wchar_t *s);
|
||||
DISPATCH(70) virtual void maki_pushVoid();
|
||||
DISPATCH(80) virtual void maki_pushAny(scriptVar v);
|
||||
DISPATCH(90) virtual void *maki_popObject();
|
||||
DISPATCH(100) virtual int maki_popInt();
|
||||
DISPATCH(110) virtual bool maki_popBoolean();
|
||||
DISPATCH(120) virtual float maki_popFloat();
|
||||
DISPATCH(130) virtual double maki_popDouble();
|
||||
DISPATCH(140) virtual const wchar_t *maki_popString();
|
||||
DISPATCH(150) virtual scriptVar maki_popAny();
|
||||
DISPATCH(160) virtual void maki_popDiscard();
|
||||
DISPATCH(170) virtual const wchar_t *maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p);
|
||||
DISPATCH(180) virtual int maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host);
|
||||
DISPATCH(190) virtual void maki_addDlfClassRef(ScriptObjectController *o, void *host);
|
||||
DISPATCH(200) virtual void maki_remDlfRef(void *host);
|
||||
DISPATCH(210) virtual scriptVar maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params);
|
||||
DISPATCH(220) virtual scriptVar maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid = -1);
|
||||
DISPATCH(230) virtual int maki_getScriptInt(scriptVar v);
|
||||
DISPATCH(240) virtual bool maki_getScriptBoolean(scriptVar v);
|
||||
DISPATCH(250) virtual float maki_getScriptFloat(scriptVar v);
|
||||
DISPATCH(260) virtual double maki_getScriptDouble(scriptVar v);
|
||||
DISPATCH(270) virtual const wchar_t *maki_getScriptString(scriptVar v);
|
||||
DISPATCH(280) virtual ScriptObject *maki_getScriptObject(scriptVar v);
|
||||
DISPATCH(290) virtual scriptVar maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount);
|
||||
DISPATCH(300) virtual ScriptObject *maki_instantiate(GUID classguid);
|
||||
DISPATCH(310) virtual void maki_destroy(ScriptObject *o);
|
||||
DISPATCH(320) virtual void *maki_encapsulate(GUID classguid, ScriptObject *o);
|
||||
DISPATCH(330) virtual void maki_deencapsulate(GUID classguid, void *o);
|
||||
DISPATCH(340) virtual ScriptObjectController *maki_getController(GUID scriptclass);
|
||||
DISPATCH(350) virtual int maki_createOrphan(int type);
|
||||
DISPATCH(360) virtual void maki_killOrphan(int id);
|
||||
DISPATCH(370) virtual void maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object);
|
||||
DISPATCH(380) virtual ScriptObject *maki_getObjectAtom(const wchar_t *atomname);
|
||||
/*[interface.maki_findObject.cpp]#ifdef WASABI_COMPILE_WND*/
|
||||
/*[interface.maki_findObject.h]#ifdef WASABI_COMPILE_WND*/
|
||||
/*[dispatchable.maki_findObject.enum]#ifdef WASABI_COMPILE_WND*/
|
||||
/*[dispatchable.maki_findObject.bridge]#ifdef WASABI_COMPILE_WND*/
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
DISPATCH(390) virtual ScriptObject *maki_findObject(const wchar_t *name);
|
||||
#endif
|
||||
/*[interface.vcpu_addScriptObject.cpp]#endif*/
|
||||
/*[interface.vcpu_addScriptObject.h]#endif*/
|
||||
/*[dispatchable.vcpu_addScriptObject.enum]#endif*/
|
||||
/*[dispatchable.vcpu_addScriptObject.bridge]#endif*/
|
||||
DISPATCH(400) virtual void vcpu_addScriptObject(ScriptObject *o);
|
||||
DISPATCH(410) virtual void vcpu_removeScriptObject(ScriptObject *o);
|
||||
DISPATCH(420) virtual int vcpu_getCacheCount();
|
||||
DISPATCH(430) virtual int vcpu_isValidScriptId(int id);
|
||||
DISPATCH(440) virtual int vcpu_mapVarId(int varid, int scriptid);
|
||||
DISPATCH(450) virtual int vcpu_getUserAncestorId(int varid, int scriptid);
|
||||
DISPATCH(460) virtual int vcpu_getNumEvents();
|
||||
DISPATCH(470) virtual int vcpu_getEvent(int event, int *dlf, int *script, int *var);
|
||||
DISPATCH(480) virtual int vcpu_getComplete();
|
||||
DISPATCH(481) virtual void vcpu_setComplete();
|
||||
DISPATCH(482) virtual void vcpu_resetComplete();
|
||||
DISPATCH(490) virtual const wchar_t *vcpu_getClassName(int vcpuid, int localclassid);
|
||||
|
||||
NODISPATCH void init();
|
||||
};
|
||||
|
||||
/*[interface.footer.h]
|
||||
// {F2398F09-63B0-4442-86C9-F8BC473F6DA7}
|
||||
static const GUID makiApiServiceGuid =
|
||||
{ 0xf2398f09, 0x63b0, 0x4442, { 0x86, 0xc9, 0xf8, 0xbc, 0x47, 0x3f, 0x6d, 0xa7 } };
|
||||
|
||||
extern api_maki *makiApi;
|
||||
*/
|
||||
|
||||
#endif
|
72
Src/Wasabi/api/script/api_makix.cpp
Normal file
72
Src/Wasabi/api/script/api_makix.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Generated by InterfaceFactory [Fri Oct 01 02:49:41 1999]
|
||||
//
|
||||
// File : api_makix.cpp
|
||||
// Class : api_maki
|
||||
// class layer : Dispatchable Receiver
|
||||
// ----------------------------------------------------------------------------
|
||||
#include <precomp.h>
|
||||
|
||||
#include "api_makix.h"
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
|
||||
#define CBCLASS api_makiX
|
||||
START_DISPATCH;
|
||||
VCB(API_MAKI_MAKI_PUSHOBJECT, maki_pushObject);
|
||||
VCB(API_MAKI_MAKI_PUSHINT, maki_pushInt);
|
||||
VCB(API_MAKI_MAKI_PUSHBOOLEAN, maki_pushBoolean);
|
||||
VCB(API_MAKI_MAKI_PUSHFLOAT, maki_pushFloat);
|
||||
VCB(API_MAKI_MAKI_PUSHDOUBLE, maki_pushDouble);
|
||||
VCB(API_MAKI_MAKI_PUSHSTRING, maki_pushString);
|
||||
VCB(API_MAKI_MAKI_PUSHVOID, maki_pushVoid);
|
||||
VCB(API_MAKI_MAKI_PUSHANY, maki_pushAny);
|
||||
CB(API_MAKI_MAKI_POPOBJECT, maki_popObject);
|
||||
CB(API_MAKI_MAKI_POPINT, maki_popInt);
|
||||
CB(API_MAKI_MAKI_POPBOOLEAN, maki_popBoolean);
|
||||
CB(API_MAKI_MAKI_POPFLOAT, maki_popFloat);
|
||||
CB(API_MAKI_MAKI_POPDOUBLE, maki_popDouble);
|
||||
CB(API_MAKI_MAKI_POPSTRING, maki_popString);
|
||||
CB(API_MAKI_MAKI_POPANY, maki_popAny);
|
||||
VCB(API_MAKI_MAKI_POPDISCARD, maki_popDiscard);
|
||||
CB(API_MAKI_MAKI_GETFUNCTION, maki_getFunction);
|
||||
CB(API_MAKI_MAKI_ADDDLFREF, maki_addDlfRef);
|
||||
VCB(API_MAKI_MAKI_ADDDLFCLASSREF, maki_addDlfClassRef);
|
||||
VCB(API_MAKI_MAKI_REMDLFREF, maki_remDlfRef);
|
||||
CB(API_MAKI_MAKI_CALLFUNCTION, maki_callFunction);
|
||||
CB(API_MAKI_MAKI_TRIGGEREVENT, maki_triggerEvent);
|
||||
CB(API_MAKI_MAKI_GETSCRIPTINT, maki_getScriptInt);
|
||||
CB(API_MAKI_MAKI_GETSCRIPTBOOLEAN, maki_getScriptBoolean);
|
||||
CB(API_MAKI_MAKI_GETSCRIPTFLOAT, maki_getScriptFloat);
|
||||
CB(API_MAKI_MAKI_GETSCRIPTDOUBLE, maki_getScriptDouble);
|
||||
CB(API_MAKI_MAKI_GETSCRIPTSTRING, maki_getScriptString);
|
||||
CB(API_MAKI_MAKI_GETSCRIPTOBJECT, maki_getScriptObject);
|
||||
CB(API_MAKI_MAKI_UPDATEDLF, maki_updateDlf);
|
||||
CB(API_MAKI_MAKI_INSTANTIATE, maki_instantiate);
|
||||
VCB(API_MAKI_MAKI_DESTROY, maki_destroy);
|
||||
CB(API_MAKI_MAKI_ENCAPSULATE, maki_encapsulate);
|
||||
VCB(API_MAKI_MAKI_DEENCAPSULATE, maki_deencapsulate);
|
||||
CB(API_MAKI_MAKI_GETCONTROLLER, maki_getController);
|
||||
CB(API_MAKI_MAKI_CREATEORPHAN, maki_createOrphan);
|
||||
VCB(API_MAKI_MAKI_KILLORPHAN, maki_killOrphan);
|
||||
VCB(API_MAKI_MAKI_SETOBJECTATOM, maki_setObjectAtom);
|
||||
CB(API_MAKI_MAKI_GETOBJECTATOM, maki_getObjectAtom);
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
CB(API_MAKI_MAKI_FINDOBJECT, maki_findObject);
|
||||
#endif
|
||||
VCB(API_MAKI_VCPU_ADDSCRIPTOBJECT, vcpu_addScriptObject);
|
||||
VCB(API_MAKI_VCPU_REMOVESCRIPTOBJECT, vcpu_removeScriptObject);
|
||||
CB(API_MAKI_VCPU_GETCACHECOUNT, vcpu_getCacheCount);
|
||||
CB(API_MAKI_VCPU_ISVALIDSCRIPTID, vcpu_isValidScriptId);
|
||||
CB(API_MAKI_VCPU_MAPVARID, vcpu_mapVarId);
|
||||
CB(API_MAKI_VCPU_GETUSERANCESTORID, vcpu_getUserAncestorId);
|
||||
CB(API_MAKI_VCPU_GETNUMEVENTS, vcpu_getNumEvents);
|
||||
CB(API_MAKI_VCPU_GETEVENT, vcpu_getEvent);
|
||||
CB(API_MAKI_VCPU_GETCOMPLETE, vcpu_getComplete);
|
||||
VCB(API_MAKI_VCPU_SETCOMPLETE, vcpu_setComplete);
|
||||
VCB(API_MAKI_VCPU_RESETCOMPLETE, vcpu_resetComplete);
|
||||
CB(API_MAKI_VCPU_GETCLASSNAME, vcpu_getClassName);
|
||||
END_DISPATCH;
|
||||
#undef CBCLASS
|
81
Src/Wasabi/api/script/api_makix.h
Normal file
81
Src/Wasabi/api/script/api_makix.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Generated by InterfaceFactory [Fri Oct 01 02:49:40 1999]
|
||||
//
|
||||
// File : api_makix.h
|
||||
// Class : api_maki
|
||||
// class layer : Dispatchable Receiver
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __API_MAKIX_H
|
||||
#define __API_MAKIX_H
|
||||
|
||||
#include "api_maki.h"
|
||||
|
||||
class ScriptObject;
|
||||
class ScriptObjectController;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class api_makiX : public api_maki {
|
||||
protected:
|
||||
api_makiX() {}
|
||||
public:
|
||||
virtual void maki_pushObject(void *o)=0;
|
||||
virtual void maki_pushInt(int i)=0;
|
||||
virtual void maki_pushBoolean(int b)=0;
|
||||
virtual void maki_pushFloat(float f)=0;
|
||||
virtual void maki_pushDouble(double d)=0;
|
||||
virtual void maki_pushString(const wchar_t *s)=0;
|
||||
virtual void maki_pushVoid()=0;
|
||||
virtual void maki_pushAny(scriptVar v)=0;
|
||||
virtual void *maki_popObject()=0;
|
||||
virtual int maki_popInt()=0;
|
||||
virtual bool maki_popBoolean()=false;
|
||||
virtual float maki_popFloat()=0;
|
||||
virtual double maki_popDouble()=0;
|
||||
virtual const wchar_t *maki_popString()=0;
|
||||
virtual scriptVar maki_popAny()=0;
|
||||
virtual void maki_popDiscard()=0;
|
||||
virtual const wchar_t *maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p)=0;
|
||||
virtual int maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host)=0;
|
||||
virtual void maki_addDlfClassRef(ScriptObjectController *o, void *host)=0;
|
||||
virtual void maki_remDlfRef(void *host)=0;
|
||||
virtual scriptVar maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params)=0;
|
||||
virtual scriptVar maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid = -1)=0;
|
||||
virtual int maki_getScriptInt(scriptVar v)=0;
|
||||
virtual bool maki_getScriptBoolean(scriptVar v)=false;
|
||||
virtual float maki_getScriptFloat(scriptVar v)=0;
|
||||
virtual double maki_getScriptDouble(scriptVar v)=0;
|
||||
virtual const wchar_t *maki_getScriptString(scriptVar v)=0;
|
||||
virtual ScriptObject *maki_getScriptObject(scriptVar v)=0;
|
||||
virtual scriptVar maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount)=0;
|
||||
virtual ScriptObject *maki_instantiate(GUID classguid)=0;
|
||||
virtual void maki_destroy(ScriptObject *o)=0;
|
||||
virtual void *maki_encapsulate(GUID classguid, ScriptObject *o)=0;
|
||||
virtual void maki_deencapsulate(GUID classguid, void *o)=0;
|
||||
virtual ScriptObjectController *maki_getController(GUID scriptclass)=0;
|
||||
virtual int maki_createOrphan(int type)=0;
|
||||
virtual void maki_killOrphan(int id)=0;
|
||||
virtual void maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object)=0;
|
||||
virtual ScriptObject *maki_getObjectAtom(const wchar_t *atomname)=0;
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
virtual ScriptObject *maki_findObject(const wchar_t *name)=0;
|
||||
#endif
|
||||
virtual void vcpu_addScriptObject(ScriptObject *o)=0;
|
||||
virtual void vcpu_removeScriptObject(ScriptObject *o)=0;
|
||||
virtual int vcpu_getCacheCount()=0;
|
||||
virtual int vcpu_isValidScriptId(int id)=0;
|
||||
virtual int vcpu_mapVarId(int varid, int scriptid)=0;
|
||||
virtual int vcpu_getUserAncestorId(int varid, int scriptid)=0;
|
||||
virtual int vcpu_getNumEvents()=0;
|
||||
virtual int vcpu_getEvent(int event, int *dlf, int *script, int *var)=0;
|
||||
virtual int vcpu_getComplete()=0;
|
||||
virtual void vcpu_setComplete()=0;
|
||||
virtual void vcpu_resetComplete()=0;
|
||||
virtual const wchar_t *vcpu_getClassName(int vcpuid, int localclassid)=0;
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
#endif // __API_MAKIX_H
|
20
Src/Wasabi/api/script/debugger/api_makidebug.cpp
Normal file
20
Src/Wasabi/api/script/debugger/api_makidebug.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <precomp.h>
|
||||
#include "api_makidebug.h"
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
#define CBCLASS api_makiDebuggerI
|
||||
START_DISPATCH;
|
||||
VCB(API_MAKIDEBUGGER_DEBUGGER_TRACE, debugger_trace);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_ISACTIVE, debugger_isActive);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVIP, debugger_getVIP);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVSD, debugger_getVSD);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVCC, debugger_getVCC);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETVSP, debugger_getVSP);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_FILTEREVENT, debugger_filterEvent);
|
||||
VCB(API_MAKIDEBUGGER_DEBUGGER_EVENTCOMPLETE, debugger_eventComplete);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_CREATEJITD, debugger_createJITD);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_READSTACK, debugger_readStack);
|
||||
CB(API_MAKIDEBUGGER_DEBUGGER_GETCODEBLOCK, debugger_getCodeBlock);
|
||||
END_DISPATCH;
|
134
Src/Wasabi/api/script/debugger/api_makidebug.h
Normal file
134
Src/Wasabi/api/script/debugger/api_makidebug.h
Normal file
|
@ -0,0 +1,134 @@
|
|||
#ifndef __API_MAKIDEBUG_H
|
||||
#define __API_MAKIDEBUG_H
|
||||
|
||||
/*---------------------------------------------------------
|
||||
api_makiDebugger
|
||||
void debugger_trace();
|
||||
int debugger_isActive();
|
||||
int debugger_getVIP();
|
||||
int debugger_getVSD();
|
||||
int debugger_getVCC();
|
||||
int debugger_getVSP();
|
||||
int debugger_filterEvent(int vcpuid, int eventid);
|
||||
void debugger_eventComplete();
|
||||
MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1);
|
||||
int debugger_readStack(int n);
|
||||
int debugger_getCodeBlock(int vcpuid);
|
||||
---------------------------------------------------------*/
|
||||
|
||||
#include <wasabicfg.h>
|
||||
|
||||
#ifndef WASABI_COMPILE_SCRIPT
|
||||
#error "This module requires the script api"
|
||||
#endif
|
||||
|
||||
#ifndef WASABI_COMPILE_MAKIDEBUG
|
||||
#error "This module requires the script debugger api"
|
||||
#endif
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <api/script/scriptvar.h>
|
||||
|
||||
class MakiJITD;
|
||||
|
||||
class NOVTABLE api_makiDebugger : public Dispatchable {
|
||||
public:
|
||||
void debugger_trace();
|
||||
int debugger_isActive();
|
||||
int debugger_getVIP();
|
||||
int debugger_getVSD();
|
||||
int debugger_getVCC();
|
||||
int debugger_getVSP();
|
||||
int debugger_filterEvent(int vcpuid, int eventid);
|
||||
void debugger_eventComplete();
|
||||
MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1);
|
||||
scriptVar debugger_readStack(int n);
|
||||
const char *debugger_getCodeBlock(int vcpuid);
|
||||
|
||||
enum {
|
||||
API_MAKIDEBUGGER_DEBUGGER_TRACE = 0,
|
||||
API_MAKIDEBUGGER_DEBUGGER_ISACTIVE = 10,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVIP = 20,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVSD = 30,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVCC = 40,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETVSP = 50,
|
||||
API_MAKIDEBUGGER_DEBUGGER_FILTEREVENT = 60,
|
||||
API_MAKIDEBUGGER_DEBUGGER_EVENTCOMPLETE = 70,
|
||||
API_MAKIDEBUGGER_DEBUGGER_CREATEJITD = 80,
|
||||
API_MAKIDEBUGGER_DEBUGGER_READSTACK = 90,
|
||||
API_MAKIDEBUGGER_DEBUGGER_GETCODEBLOCK = 100,
|
||||
};
|
||||
};
|
||||
|
||||
inline void api_makiDebugger::debugger_trace() {
|
||||
_voidcall(API_MAKIDEBUGGER_DEBUGGER_TRACE);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_isActive() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_ISACTIVE, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVIP() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVIP, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVSD() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVSD, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVCC() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVCC, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_getVSP() {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETVSP, (int)0);
|
||||
}
|
||||
|
||||
inline int api_makiDebugger::debugger_filterEvent(int vcpuid, int eventid) {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_FILTEREVENT, (int)0, vcpuid, eventid);
|
||||
}
|
||||
|
||||
inline void api_makiDebugger::debugger_eventComplete() {
|
||||
_voidcall(API_MAKIDEBUGGER_DEBUGGER_EVENTCOMPLETE);
|
||||
}
|
||||
|
||||
inline MakiJITD *api_makiDebugger::debugger_createJITD(int vcpuid, int bringitup) {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_CREATEJITD, (MakiJITD *)NULL, vcpuid, bringitup);
|
||||
}
|
||||
|
||||
inline const char *api_makiDebugger::debugger_getCodeBlock(int vcpuid) {
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_GETCODEBLOCK, (const char *)NULL, vcpuid);
|
||||
}
|
||||
|
||||
inline scriptVar api_makiDebugger::debugger_readStack(int n) {
|
||||
scriptVar v={0,0};
|
||||
return _call(API_MAKIDEBUGGER_DEBUGGER_READSTACK, v, n);
|
||||
}
|
||||
|
||||
class api_makiDebuggerI : public api_makiDebugger {
|
||||
public:
|
||||
virtual void debugger_trace()=0;
|
||||
virtual int debugger_isActive()=0;
|
||||
virtual int debugger_getVIP()=0;
|
||||
virtual int debugger_getVSD()=0;
|
||||
virtual int debugger_getVCC()=0;
|
||||
virtual int debugger_getVSP()=0;
|
||||
virtual int debugger_filterEvent(int vcpuid, int eventid)=0;
|
||||
virtual void debugger_eventComplete()=0;
|
||||
virtual MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1)=0;
|
||||
virtual scriptVar debugger_readStack(int n)=0;
|
||||
virtual const char *debugger_getCodeBlock(int vcpuid)=0;
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
// {858E4B64-AF1E-4b64-8D27-EFFAD9F82BB4}
|
||||
static const GUID makiDebugApiServiceGuid =
|
||||
{ 0x858e4b64, 0xaf1e, 0x4b64, { 0x8d, 0x27, 0xef, 0xfa, 0xd9, 0xf8, 0x2b, 0xb4 } };
|
||||
|
||||
extern api_makiDebugger *debugApi;
|
||||
|
||||
#endif
|
||||
|
||||
|
62
Src/Wasabi/api/script/debugger/debugapi.cpp
Normal file
62
Src/Wasabi/api/script/debugger/debugapi.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#include <precomp.h>
|
||||
#include <api/script/debugger/debugapi.h>
|
||||
#include <api/script/debugger/jitd.h>
|
||||
#include <api/script/vcpu.h>
|
||||
|
||||
api_makiDebugger *debugApi = NULL;
|
||||
|
||||
MakiDebuggerApi::MakiDebuggerApi()
|
||||
{
|
||||
}
|
||||
|
||||
MakiDebuggerApi::~MakiDebuggerApi() {
|
||||
|
||||
}
|
||||
|
||||
void MakiDebuggerApi::debugger_trace() {
|
||||
debugger.trace();
|
||||
}
|
||||
|
||||
int MakiDebuggerApi::debugger_isActive() {
|
||||
return debugger.isActive();
|
||||
}
|
||||
|
||||
int MakiDebuggerApi::debugger_getVIP() {
|
||||
return VCPU::VIP;
|
||||
}
|
||||
|
||||
int MakiDebuggerApi::debugger_getVSD() {
|
||||
return VCPU::VSD;
|
||||
}
|
||||
|
||||
int MakiDebuggerApi::debugger_getVCC() {
|
||||
return VCPU::VCC;
|
||||
}
|
||||
|
||||
int MakiDebuggerApi::debugger_getVSP() {
|
||||
return VCPU::VSP;
|
||||
}
|
||||
|
||||
int MakiDebuggerApi::debugger_filterEvent(int vcpuid, int eventid) {
|
||||
return debugger.filterEvent(vcpuid, eventid);
|
||||
}
|
||||
|
||||
void MakiDebuggerApi::debugger_eventComplete() {
|
||||
debugger.eventComplete();
|
||||
}
|
||||
|
||||
MakiJITD *MakiDebuggerApi::debugger_createJITD(int vcpuid, int bringitup) {
|
||||
MakiJITD *jitd = debugger.createJITD(vcpuid);
|
||||
if (bringitup)
|
||||
jitd->setGlobalBreakpoint(1);
|
||||
return jitd;
|
||||
}
|
||||
|
||||
scriptVar MakiDebuggerApi::debugger_readStack(int n) {
|
||||
VCPUscriptVar v = VCPU::peekAt(n);
|
||||
return v.v;
|
||||
}
|
||||
|
||||
const char *MakiDebuggerApi::debugger_getCodeBlock(int vcpuid) {
|
||||
return VCPU::getCodeBlock(vcpuid);
|
||||
}
|
28
Src/Wasabi/api/script/debugger/debugapi.h
Normal file
28
Src/Wasabi/api/script/debugger/debugapi.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef __MAKIDEBUGAPI_H
|
||||
#define __MAKIDEBUGAPI_H
|
||||
|
||||
#include <api/script/debugger/api_makidebug.h>
|
||||
#include <api/script/debugger/vcpudebug.h>
|
||||
|
||||
class MakiDebuggerApi : public api_makiDebuggerI {
|
||||
public:
|
||||
MakiDebuggerApi();
|
||||
virtual ~MakiDebuggerApi();
|
||||
|
||||
virtual void debugger_trace();
|
||||
virtual int debugger_isActive();
|
||||
virtual int debugger_getVIP();
|
||||
virtual int debugger_getVSD();
|
||||
virtual int debugger_getVCC();
|
||||
virtual int debugger_getVSP();
|
||||
virtual int debugger_filterEvent(int vcpuid, int eventid);
|
||||
virtual void debugger_eventComplete();
|
||||
virtual MakiJITD *debugger_createJITD(int vcpuid, int bringitup=1);
|
||||
virtual scriptVar debugger_readStack(int n);
|
||||
virtual const char *debugger_getCodeBlock(int vcpuid);
|
||||
|
||||
private:
|
||||
VCPUDebugger debugger;
|
||||
};
|
||||
|
||||
#endif
|
11
Src/Wasabi/api/script/debugger/debuggerui.cpp
Normal file
11
Src/Wasabi/api/script/debugger/debuggerui.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include <precomp.h>
|
||||
#include "debuggerui.h"
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
#define CBCLASS DebuggerUII
|
||||
START_DISPATCH;
|
||||
CB(DEBUGGERUI_MESSAGELOOP, messageLoop);
|
||||
VCB(DEBUGGERUI_SETJITD, setJITD);
|
||||
END_DISPATCH;
|
42
Src/Wasabi/api/script/debugger/debuggerui.h
Normal file
42
Src/Wasabi/api/script/debugger/debuggerui.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
#ifndef __DEBUGGERUI_H
|
||||
#define __DEBUGGERUI_H
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
|
||||
class MakiJITD;
|
||||
|
||||
/*-------------------------------------------
|
||||
DebuggerUI
|
||||
int messageLoop();
|
||||
void setJITD(MakiJITD *jitd);
|
||||
-------------------------------------------*/
|
||||
|
||||
class DebuggerUI : public Dispatchable {
|
||||
public:
|
||||
int messageLoop();
|
||||
void setJITD(MakiJITD *jitd);
|
||||
|
||||
enum {
|
||||
DEBUGGERUI_MESSAGELOOP = 0,
|
||||
DEBUGGERUI_SETJITD = 10,
|
||||
};
|
||||
};
|
||||
|
||||
inline int DebuggerUI::messageLoop() {
|
||||
return _call(DEBUGGERUI_MESSAGELOOP, (int)0);
|
||||
}
|
||||
|
||||
inline void DebuggerUI::setJITD(MakiJITD *jitd) {
|
||||
_voidcall(DEBUGGERUI_SETJITD, jitd);
|
||||
}
|
||||
|
||||
class DebuggerUII : public DebuggerUI {
|
||||
public:
|
||||
virtual int messageLoop()=0;
|
||||
virtual void setJITD(MakiJITD *jitd)=0;
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
#endif
|
75
Src/Wasabi/api/script/debugger/debugsymbols.cpp
Normal file
75
Src/Wasabi/api/script/debugger/debugsymbols.cpp
Normal file
|
@ -0,0 +1,75 @@
|
|||
#include <precomp.h>
|
||||
#include "debugsymbols.h"
|
||||
#include <api/script/debugger/disasm.h>
|
||||
#include <api/script/scriptmgr.h>
|
||||
#include <api/script/debugger/sourcecodeline.h>
|
||||
#include <api/script/vcpu.h>
|
||||
|
||||
DebugSymbols::DebugSymbols(int _vcpuid) : disasm(_vcpuid)
|
||||
{
|
||||
gotsymbols = 0;
|
||||
SystemObject *so = SOM::getSystemObjectByScriptId(_vcpuid);
|
||||
if (so != NULL)
|
||||
binaryfilename = so->getFilename();
|
||||
|
||||
VCPUcodeBlock *cb = VCPU::getCodeBlockEntry(_vcpuid);
|
||||
if (cb->debugsize != 0) {
|
||||
gotsymbols = 1;
|
||||
char *p = cb->debugsymbols;
|
||||
int n = *(int *)p; p += 4;
|
||||
while (n--) {
|
||||
int s = *(int *)p; p += 4;
|
||||
wchar_t *m = WMALLOC(s+1);
|
||||
MEMCPY(m, p, s*sizeof(wchar_t));
|
||||
m[s] = 0;
|
||||
StringW *temp = new StringW;
|
||||
temp->own(m);
|
||||
//files.addItem(new String(m));
|
||||
files.addItem(temp);
|
||||
//FREE(m);
|
||||
p+=s;
|
||||
}
|
||||
n = *(int *)p; p += 4;
|
||||
while (n--) {
|
||||
SourceCodeLineI *l = new SourceCodeLineI();
|
||||
l->setPointer(*(int *)p); p += 4;
|
||||
l->setSourceFile(files[*(int *)p]->getValue()); p += 4;
|
||||
l->setSourceFileLine(*(int *)p); p += 4;
|
||||
SourceCodeLineI *last = lines.getLast();
|
||||
if (last != NULL) last->setLength(l->getPointer()-last->getPointer());
|
||||
lines.addItem(l);
|
||||
}
|
||||
SourceCodeLineI *last = lines.getLast();
|
||||
if (last != NULL) last->setLength(cb->size - last->getPointer());
|
||||
}
|
||||
}
|
||||
|
||||
DebugSymbols::~DebugSymbols()
|
||||
{
|
||||
files.deleteAll();
|
||||
lines.deleteAll();
|
||||
}
|
||||
|
||||
int DebugSymbols::getNumLines() {
|
||||
if (!gotsymbols) return disasm.getNumLines();
|
||||
return lines.getNumItems();
|
||||
}
|
||||
|
||||
int DebugSymbols::findLine(int pointer) {
|
||||
if (!gotsymbols) return disasm.findLine(pointer);
|
||||
int i;
|
||||
for (i=0;i<lines.getNumItems();i++) {
|
||||
SourceCodeLine *l = lines.enumItem(i);
|
||||
int ip = l->getPointer();
|
||||
int il = l->getLength();
|
||||
if (pointer >= ip && pointer < ip+il) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
SourceCodeLine *DebugSymbols::enumLine(int n) {
|
||||
if (!gotsymbols) return disasm.enumLine(n);
|
||||
return lines.enumItem(n);
|
||||
}
|
38
Src/Wasabi/api/script/debugger/debugsymbols.h
Normal file
38
Src/Wasabi/api/script/debugger/debugsymbols.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#ifndef __DEBUGSYMBOLS_H
|
||||
#define __DEBUGSYMBOLS_H
|
||||
|
||||
#include <bfc/ptrlist.h>
|
||||
#include <bfc/string/StringW.h>
|
||||
#include "disasm.h"
|
||||
|
||||
class SourceCodeLine;
|
||||
class SourceCodeLineI;
|
||||
class MakiDisassembler;
|
||||
|
||||
class DebugSymbols {
|
||||
|
||||
public:
|
||||
|
||||
DebugSymbols(int vcpuid);
|
||||
virtual ~DebugSymbols();
|
||||
|
||||
virtual int getNumLines();
|
||||
virtual int findLine(int pointer);
|
||||
virtual SourceCodeLine *enumLine(int n);
|
||||
|
||||
private:
|
||||
|
||||
PtrList<SourceCodeLineI> lines;
|
||||
MakiDisassembler disasm;
|
||||
StringW binaryfilename;
|
||||
int gotsymbols;
|
||||
PtrList<StringW> files;
|
||||
//PtrList<MakiVariable> vars;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
193
Src/Wasabi/api/script/debugger/disasm.cpp
Normal file
193
Src/Wasabi/api/script/debugger/disasm.cpp
Normal file
|
@ -0,0 +1,193 @@
|
|||
#include <precomp.h>
|
||||
#include <api/script/debugger/disasm.h>
|
||||
#include <api/script/opcodes.h>
|
||||
#include <api/script/vcpu.h>
|
||||
#include <api/script/debugger/sourcecodeline.h>
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
typedef struct {
|
||||
const wchar_t *opname;
|
||||
unsigned __int8 opval;
|
||||
int type;
|
||||
} opentry;
|
||||
|
||||
opentry _optable[] = {
|
||||
{L"nop", OPCODE_NOP, OPCODE_TYPE_VOID},
|
||||
{L"push", OPCODE_PUSH, OPCODE_TYPE_VAR},
|
||||
{L"popi", OPCODE_POPI, OPCODE_TYPE_VOID},
|
||||
{L"pop", OPCODE_POP, OPCODE_TYPE_VAR},
|
||||
{L"set ", OPCODE_SET, OPCODE_TYPE_VOID},
|
||||
{L"retf", OPCODE_RETF, OPCODE_TYPE_VOID},
|
||||
{L"call", OPCODE_CALLC, OPCODE_TYPE_PTR},
|
||||
{L"call", OPCODE_CALLM, OPCODE_TYPE_DLF},
|
||||
{L"call", OPCODE_CALLM2, OPCODE_TYPE_NDLF},
|
||||
{L"umv", OPCODE_UMV, OPCODE_TYPE_DISCARD},
|
||||
{L"cmpeq", OPCODE_CMPEQ, OPCODE_TYPE_VOID},
|
||||
{L"cmpne", OPCODE_CMPNE, OPCODE_TYPE_VOID},
|
||||
{L"cmpa", OPCODE_CMPA, OPCODE_TYPE_VOID},
|
||||
{L"cmpae", OPCODE_CMPAE, OPCODE_TYPE_VOID},
|
||||
{L"cmpb", OPCODE_CMPB, OPCODE_TYPE_VOID},
|
||||
{L"cmpbe", OPCODE_CMPBE, OPCODE_TYPE_VOID},
|
||||
{L"jiz", OPCODE_JIZ, OPCODE_TYPE_PTR},
|
||||
{L"jnz", OPCODE_JNZ, OPCODE_TYPE_PTR},
|
||||
{L"jmp", OPCODE_JMP, OPCODE_TYPE_PTR},
|
||||
{L"incs", OPCODE_INCS, OPCODE_TYPE_VOID},
|
||||
{L"decs", OPCODE_DECS, OPCODE_TYPE_VOID},
|
||||
{L"incp", OPCODE_INCP, OPCODE_TYPE_VOID},
|
||||
{L"decp", OPCODE_DECP, OPCODE_TYPE_VOID},
|
||||
{L"add", OPCODE_ADD, OPCODE_TYPE_VOID},
|
||||
{L"sub", OPCODE_SUB, OPCODE_TYPE_VOID},
|
||||
{L"mul", OPCODE_MUL, OPCODE_TYPE_VOID},
|
||||
{L"div", OPCODE_DIV, OPCODE_TYPE_VOID},
|
||||
{L"mod", OPCODE_MOD, OPCODE_TYPE_VOID},
|
||||
{L"neg", OPCODE_NEG, OPCODE_TYPE_VOID},
|
||||
{L"shl", OPCODE_SHL, OPCODE_TYPE_VOID},
|
||||
{L"shr", OPCODE_SHR, OPCODE_TYPE_VOID},
|
||||
{L"bnot", OPCODE_BNOT, OPCODE_TYPE_VOID},
|
||||
{L"bxor", OPCODE_XOR, OPCODE_TYPE_VOID},
|
||||
{L"band", OPCODE_AND, OPCODE_TYPE_VOID},
|
||||
{L"bor", OPCODE_OR, OPCODE_TYPE_VOID},
|
||||
{L"not", OPCODE_NOT, OPCODE_TYPE_VOID},
|
||||
{L"and", OPCODE_LAND, OPCODE_TYPE_VOID},
|
||||
{L"or", OPCODE_LOR, OPCODE_TYPE_VOID},
|
||||
{L"del", OPCODE_DELETE, OPCODE_TYPE_VOID},
|
||||
{L"new", OPCODE_NEW, OPCODE_TYPE_CLASSID},
|
||||
{L"cmpl", OPCODE_CMPLT, OPCODE_TYPE_VOID},
|
||||
};
|
||||
|
||||
int MakiDisassembler::optable[256];
|
||||
int MakiDisassembler::optableready = 0;
|
||||
|
||||
|
||||
MakiDisassembler::MakiDisassembler(int _vcpuid) {
|
||||
if (!optableready) {
|
||||
MEMSET(optable, 0, sizeof(optable));
|
||||
for (int i=0;i<sizeof(_optable)/sizeof(opentry);i++) {
|
||||
opentry e = _optable[i];
|
||||
optable[e.opval] = i;
|
||||
}
|
||||
optableready = 1;
|
||||
}
|
||||
vcpuid = _vcpuid;
|
||||
disassemble();
|
||||
}
|
||||
|
||||
MakiDisassembler::~MakiDisassembler() {
|
||||
lines.deleteAll();
|
||||
}
|
||||
|
||||
int MakiDisassembler::getVCPUId() {
|
||||
return vcpuid;
|
||||
}
|
||||
|
||||
int MakiDisassembler::getNumLines() {
|
||||
return lines.getNumItems();
|
||||
}
|
||||
|
||||
SourceCodeLine *MakiDisassembler::enumLine(int n) {
|
||||
return lines.enumItem(n);
|
||||
}
|
||||
|
||||
int MakiDisassembler::findLine(int pointer) {
|
||||
int i;
|
||||
for (i=0;i<lines.getNumItems();i++) {
|
||||
SourceCodeLine *l = lines.enumItem(i);
|
||||
int ip = l->getPointer();
|
||||
int il = l->getLength();
|
||||
if (pointer >= ip && pointer < ip+il) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void MakiDisassembler::disassemble() {
|
||||
int size;
|
||||
const char *codeblock = VCPU::getCodeBlock(vcpuid, &size);
|
||||
if (codeblock != NULL) {
|
||||
|
||||
const char *p = codeblock;
|
||||
|
||||
unsigned char opcode = OPCODE_NOP;
|
||||
|
||||
while (p < codeblock+size) {
|
||||
const char *start_of_instruction = p;
|
||||
opcode = *p;
|
||||
p+=sizeof(opcode);
|
||||
|
||||
StringW inst;
|
||||
int a = optable[opcode];
|
||||
int id;
|
||||
int size = 0;
|
||||
inst = _optable[a].opname;
|
||||
switch (_optable[a].type) {
|
||||
case OPCODE_TYPE_VOID:
|
||||
size = 1;
|
||||
break;
|
||||
case OPCODE_TYPE_VAR:
|
||||
id = *(int *)p; p+=sizeof(int);
|
||||
inst += StringPrintfW(L" var %08X", id);
|
||||
size = 5;
|
||||
break;
|
||||
case OPCODE_TYPE_PTR:
|
||||
id = *(int *)p; p+=sizeof(int);
|
||||
inst += StringPrintfW(L" %08X", id+(p-codeblock));
|
||||
size = 5;
|
||||
break;
|
||||
case OPCODE_TYPE_DLF: {
|
||||
id = *(int *)p; p+=sizeof(int);
|
||||
int np = *(int *)p;
|
||||
if ((np & 0xFFFF0000) == 0xFFFF0000) {
|
||||
p+=sizeof(int);
|
||||
np &= 0xFFFF;
|
||||
} else
|
||||
np = -1;
|
||||
int i = VCPU::dlfBase(vcpuid)+id;
|
||||
if (i != -1) {
|
||||
VCPUdlfEntry *e = VCPU::DLFentryTable.enumItem(i);
|
||||
if (e != NULL) {
|
||||
if (np != -1) inst += StringPrintfW(L"(%d)", np);
|
||||
inst += L" ";
|
||||
inst += e->functionName;
|
||||
}
|
||||
}
|
||||
size = 5 + ((np == -1) ? 0 : 4);
|
||||
break;
|
||||
}
|
||||
case OPCODE_TYPE_NDLF: {
|
||||
id = *(int *)p; p+=sizeof(int);
|
||||
int np = *p; p++;
|
||||
int i = VCPU::dlfBase(vcpuid)+id;
|
||||
if (i != -1) {
|
||||
VCPUdlfEntry *e = VCPU::DLFentryTable.enumItem(i);
|
||||
if (e != NULL) {
|
||||
inst += StringPrintfW(L"(%d) ", np);
|
||||
inst += e->functionName;
|
||||
}
|
||||
}
|
||||
size = 6;
|
||||
break;
|
||||
}
|
||||
case OPCODE_TYPE_CLASSID: {
|
||||
id = *(int *)p; p+=sizeof(int);
|
||||
const wchar_t *cn = WASABI_API_MAKI->vcpu_getClassName(vcpuid, id);
|
||||
inst += L" ";
|
||||
inst += cn;
|
||||
size = 5;
|
||||
break;
|
||||
}
|
||||
case OPCODE_TYPE_DISCARD:
|
||||
id = *(int *)p; p+=sizeof(int);
|
||||
size = 5;
|
||||
break;
|
||||
}
|
||||
SourceCodeLineI *scl = new SourceCodeLineI();
|
||||
scl->setLine(inst),
|
||||
scl->setPointer(start_of_instruction-codeblock);
|
||||
scl->setLength(size);
|
||||
lines.addItem(scl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
Src/Wasabi/api/script/debugger/disasm.h
Normal file
38
Src/Wasabi/api/script/debugger/disasm.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#ifndef __MakiDisassembler_H
|
||||
#define __MakiDisassembler_H
|
||||
|
||||
#include <bfc/ptrlist.h>
|
||||
|
||||
class SourceCodeLine;
|
||||
class SourceCodeLineI;
|
||||
|
||||
enum {
|
||||
OPCODE_TYPE_VOID = 0,
|
||||
OPCODE_TYPE_VAR,
|
||||
OPCODE_TYPE_PTR,
|
||||
OPCODE_TYPE_DLF,
|
||||
OPCODE_TYPE_NDLF,
|
||||
OPCODE_TYPE_CLASSID,
|
||||
OPCODE_TYPE_DISCARD,
|
||||
};
|
||||
|
||||
class MakiDisassembler {
|
||||
public:
|
||||
MakiDisassembler(int vcpuid);
|
||||
virtual ~MakiDisassembler();
|
||||
|
||||
int getVCPUId();
|
||||
int getNumLines();
|
||||
SourceCodeLine *enumLine(int n);
|
||||
int findLine(int pointer);
|
||||
|
||||
private:
|
||||
void disassemble();
|
||||
PtrList<SourceCodeLineI> lines;
|
||||
int vcpuid;
|
||||
static int optable[256];
|
||||
static int optableready;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
176
Src/Wasabi/api/script/debugger/jitd.cpp
Normal file
176
Src/Wasabi/api/script/debugger/jitd.cpp
Normal file
|
@ -0,0 +1,176 @@
|
|||
#include <precomp.h>
|
||||
#include "jitd.h"
|
||||
#include "jitdbreak.h"
|
||||
#include <api/service/svcs/svc_debuggerui.h>
|
||||
#include <api/service/svc_enum.h>
|
||||
#include <api/script/debugger/vcpudebug.h>
|
||||
#include <api/script/debugger/debuggerui.h>
|
||||
#include <api/script/debugger/sdebuggerui.h>
|
||||
#include <api/script/debugger/debugsymbols.h>
|
||||
|
||||
MakiJITD::MakiJITD(VCPUDebugger *_debugger, int _vcpuid) {
|
||||
vip = vsp = vsd = vcc = -1;
|
||||
globalbreakpoint = 1; // fucko!!
|
||||
onhold = 0;
|
||||
debugger = _debugger;
|
||||
vcpuid = _vcpuid;
|
||||
uisvc = NULL;
|
||||
ui = NULL;
|
||||
simpleui = NULL;
|
||||
codeblock = _debugger->getCodeBlock(vcpuid);
|
||||
sysbp = new JITDBreakpoint(this, 0);
|
||||
breakpoints.addItem(sysbp);
|
||||
sysbp->setEnabled(0);
|
||||
symbols = new DebugSymbols(_vcpuid);
|
||||
}
|
||||
|
||||
MakiJITD::~MakiJITD() {
|
||||
breakpoints.deleteAll();
|
||||
if (uisvc != NULL) {
|
||||
uisvc->destroyUI(ui);
|
||||
WASABI_API_SVC->service_release(uisvc);
|
||||
}
|
||||
delete simpleui;
|
||||
delete symbols;
|
||||
}
|
||||
|
||||
int MakiJITD::getVIP() {
|
||||
return vip;
|
||||
}
|
||||
|
||||
int MakiJITD::getVCC() {
|
||||
return vcc;
|
||||
}
|
||||
|
||||
int MakiJITD::getVSD() {
|
||||
return vsd;
|
||||
}
|
||||
|
||||
int MakiJITD::getVSP() {
|
||||
return vsp;
|
||||
}
|
||||
|
||||
int MakiJITD::isGlobalBreakpointSet() {
|
||||
return globalbreakpoint;
|
||||
}
|
||||
|
||||
void MakiJITD::setGlobalBreakpoint(int s) {
|
||||
globalbreakpoint = s;
|
||||
}
|
||||
|
||||
int MakiJITD::getNumBreakpoints() {
|
||||
return breakpoints.getNumItems();
|
||||
}
|
||||
|
||||
JITDBreakpoint *MakiJITD::enumBreakpoint(int n) {
|
||||
return breakpoints.enumItem(n);
|
||||
}
|
||||
|
||||
JITDBreakpoint *MakiJITD::findBreakpoint(int pointer) {
|
||||
int i;
|
||||
for (i=0;i<breakpoints.getNumItems();i++) {
|
||||
JITDBreakpoint *bp = breakpoints.enumItem(i);
|
||||
if (bp->isEnabled() && bp->getPointer() == pointer)
|
||||
return bp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void MakiJITD::addBreakpoint(int pointer) {
|
||||
breakpoints.addItem(new JITDBreakpoint(this, pointer));
|
||||
}
|
||||
|
||||
void MakiJITD::removeBreakpoint(JITDBreakpoint *breakpoint) {
|
||||
breakpoints.removeItem(breakpoint);
|
||||
delete breakpoint;
|
||||
}
|
||||
|
||||
void MakiJITD::clearAllBreakpoints() {
|
||||
breakpoints.deleteAll();
|
||||
}
|
||||
|
||||
int MakiJITD::getVCPUId() {
|
||||
return vcpuid;
|
||||
}
|
||||
|
||||
void MakiJITD::trace() {
|
||||
vip = debugger->getVIP();
|
||||
vsp = debugger->getVSP();
|
||||
vsd = debugger->getVSD();
|
||||
vcc = debugger->getVCC();
|
||||
|
||||
if (globalbreakpoint || findBreakpoint(vip)) {
|
||||
enterUi();
|
||||
}
|
||||
}
|
||||
|
||||
int MakiJITD::isActive() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void MakiJITD::enterUi() {
|
||||
createUi();
|
||||
sysbp->setEnabled(0);
|
||||
globalbreakpoint = 0;
|
||||
onhold = 1;
|
||||
int next_command = ui->messageLoop();
|
||||
onhold = 0;
|
||||
switch (next_command) {
|
||||
case JITD_RETURN_STEPINTO:
|
||||
globalbreakpoint = 1;
|
||||
break;
|
||||
case JITD_RETURN_STEPOUT:
|
||||
// for now, continue
|
||||
break;
|
||||
case JITD_RETURN_TERMINATE:
|
||||
// for now, continue
|
||||
break;
|
||||
case JITD_RETURN_CONTINUE:
|
||||
// do nothing
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MakiJITD::createUi() {
|
||||
if (ui != NULL) return;
|
||||
waServiceFactory *f = WASABI_API_SVC->service_getServiceByGuid(SERVICE_DEBUGGERUI);
|
||||
if (f != NULL) {
|
||||
uisvc = castService<svc_debuggerUI>(f);
|
||||
if (uisvc != NULL) {
|
||||
ui = uisvc->createUI();
|
||||
ui->setJITD(this);
|
||||
}
|
||||
} else {
|
||||
simpleui = new SimpleDebuggerUI();
|
||||
ui = simpleui;
|
||||
ui->setJITD(this);
|
||||
}
|
||||
}
|
||||
|
||||
int MakiJITD::isOnHold() {
|
||||
return onhold;
|
||||
}
|
||||
|
||||
const char *MakiJITD::getCodeBlock() {
|
||||
return codeblock;
|
||||
}
|
||||
|
||||
void MakiJITD::setSysBreakpoint(int pointer) {
|
||||
sysbp->setPointer(pointer);
|
||||
sysbp->setEnabled(1);
|
||||
}
|
||||
|
||||
int MakiJITD::getNumLines() {
|
||||
return symbols->getNumLines();
|
||||
}
|
||||
|
||||
SourceCodeLine *MakiJITD::enumLine(int n) {
|
||||
return symbols->enumLine(n);
|
||||
}
|
||||
|
||||
int MakiJITD::findLine(int pointer) {
|
||||
return symbols->findLine(pointer);
|
||||
}
|
||||
|
||||
|
71
Src/Wasabi/api/script/debugger/jitd.h
Normal file
71
Src/Wasabi/api/script/debugger/jitd.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
#ifndef __MAKIJITD_H
|
||||
#define __MAKIJITD_H
|
||||
|
||||
#include <bfc/ptrlist.h>
|
||||
|
||||
class JITDBreakpoint;
|
||||
class VCPUDebugger;
|
||||
class svc_debuggerUI;
|
||||
class SimpleDebuggerUI;
|
||||
class DebuggerUI;
|
||||
class DebugSymbols;
|
||||
class SourceCodeLine;
|
||||
|
||||
enum {
|
||||
JITD_RETURN_STEPINTO = 0,
|
||||
JITD_RETURN_STEPOVER = 1,
|
||||
JITD_RETURN_STEPOUT = 2,
|
||||
JITD_RETURN_TERMINATE = 3,
|
||||
JITD_RETURN_CONTINUE = 4,
|
||||
};
|
||||
|
||||
class MakiJITD { // dispatch me!
|
||||
public:
|
||||
MakiJITD(VCPUDebugger *debugger, int vcpuid);
|
||||
virtual ~MakiJITD();
|
||||
|
||||
int getNumBreakpoints();
|
||||
JITDBreakpoint *enumBreakpoint(int n);
|
||||
JITDBreakpoint *findBreakpoint(int pointer);
|
||||
void addBreakpoint(int pointer);
|
||||
void removeBreakpoint(JITDBreakpoint *breakpoint);
|
||||
void clearAllBreakpoints();
|
||||
int isGlobalBreakpointSet();
|
||||
void setGlobalBreakpoint(int s);
|
||||
void setSysBreakpoint(int pointer); // deactivates automatically next time the debugger is activated
|
||||
int getVCPUId();
|
||||
void trace();
|
||||
int isActive();
|
||||
int isOnHold(); // 1 if running in the jitd's message loop
|
||||
|
||||
int getVIP();
|
||||
int getVSD();
|
||||
int getVCC();
|
||||
int getVSP();
|
||||
|
||||
const char *getCodeBlock();
|
||||
|
||||
virtual int findLine(int pointer);
|
||||
virtual int getNumLines();
|
||||
virtual SourceCodeLine *enumLine(int n);
|
||||
|
||||
private:
|
||||
void createUi();
|
||||
void enterUi();
|
||||
|
||||
int vcpuid;
|
||||
int vip, vsd, vcc, vsp;
|
||||
int globalbreakpoint;
|
||||
|
||||
PtrList<JITDBreakpoint> breakpoints;
|
||||
VCPUDebugger *debugger;
|
||||
svc_debuggerUI *uisvc;
|
||||
DebuggerUI *ui;
|
||||
SimpleDebuggerUI *simpleui;
|
||||
int onhold;
|
||||
const char *codeblock;
|
||||
JITDBreakpoint *sysbp;
|
||||
DebugSymbols *symbols;
|
||||
};
|
||||
|
||||
#endif
|
27
Src/Wasabi/api/script/debugger/jitdbreak.cpp
Normal file
27
Src/Wasabi/api/script/debugger/jitdbreak.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "precomp.h"
|
||||
#include "jitdbreak.h"
|
||||
|
||||
JITDBreakpoint::JITDBreakpoint(MakiJITD *_jitd, int _pointer) {
|
||||
jitd = _jitd;
|
||||
pointer = _pointer;
|
||||
enabled = 1;
|
||||
}
|
||||
|
||||
JITDBreakpoint::~JITDBreakpoint() {
|
||||
}
|
||||
|
||||
int JITDBreakpoint::getPointer() {
|
||||
return pointer;
|
||||
}
|
||||
|
||||
void JITDBreakpoint::setEnabled(int e) {
|
||||
enabled = e;
|
||||
}
|
||||
|
||||
int JITDBreakpoint::isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
void JITDBreakpoint::setPointer(int _pointer) {
|
||||
pointer = _pointer;
|
||||
}
|
22
Src/Wasabi/api/script/debugger/jitdbreak.h
Normal file
22
Src/Wasabi/api/script/debugger/jitdbreak.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef __JITDBREAKPOINT_H
|
||||
#define __JITDBREAKPOINT_H
|
||||
|
||||
class MakiJITD;
|
||||
|
||||
class JITDBreakpoint {
|
||||
public:
|
||||
JITDBreakpoint(MakiJITD *jitd, int pointer);
|
||||
virtual ~JITDBreakpoint();
|
||||
|
||||
virtual int getPointer();
|
||||
virtual void setPointer(int pointer);
|
||||
virtual void setEnabled(int e);
|
||||
virtual int isEnabled();
|
||||
|
||||
private:
|
||||
MakiJITD *jitd;
|
||||
int pointer;
|
||||
int enabled;
|
||||
};
|
||||
|
||||
#endif
|
437
Src/Wasabi/api/script/debugger/sdebuggerui.cpp
Normal file
437
Src/Wasabi/api/script/debugger/sdebuggerui.cpp
Normal file
|
@ -0,0 +1,437 @@
|
|||
#include <precomp.h>
|
||||
#include "sdebuggerui.h"
|
||||
#include <api/script/debugger/jitd.h>
|
||||
#include <tataki/canvas/canvas.h>
|
||||
#include <api/wnd/wndclass/editwnd.h>
|
||||
#include <api/script/objcontroller.h>
|
||||
#include <bfc/string/stringdict.h>
|
||||
#include <bfc/parse/paramparser.h>
|
||||
#include <api/wnd/notifmsg.h>
|
||||
#include <api/script/objecttable.h>
|
||||
#include <api/script/debugger/sourcecodeline.h>
|
||||
#include "../nu/AutoWide.h"
|
||||
|
||||
#define LEFTCOLUMN 100
|
||||
#define RIGHTCOLUMN 200
|
||||
#define INPUTHEIGHT 21
|
||||
#define NCONSOLELINES 4
|
||||
#define LINEHEIGHT 14
|
||||
#define REGWIDTH 100
|
||||
|
||||
SimpleDebuggerUI::SimpleDebuggerUI()
|
||||
{
|
||||
leave = 0;
|
||||
jitd = NULL;
|
||||
edit = NULL;
|
||||
memset(cmdbuf, 0, sizeof(cmdbuf));
|
||||
retcode = JITD_RETURN_CONTINUE;
|
||||
}
|
||||
|
||||
SimpleDebuggerUI::~SimpleDebuggerUI()
|
||||
{}
|
||||
|
||||
void SimpleDebuggerUI::setJITD(MakiJITD *_jitd)
|
||||
{
|
||||
jitd = _jitd;
|
||||
}
|
||||
|
||||
int SimpleDebuggerUI::messageLoop()
|
||||
{
|
||||
leave = 0;
|
||||
retcode = JITD_RETURN_STEPINTO;
|
||||
|
||||
if (!isInited())
|
||||
{
|
||||
setVirtual(0);
|
||||
setStartHidden(1);
|
||||
setParent(WASABI_API_WND->main_getRootWnd());
|
||||
init(WASABI_API_WND->main_getRootWnd(), 1);
|
||||
|
||||
edit = new EditWnd;
|
||||
edit->setParent(this);
|
||||
edit->setBackgroundColor(RGB(0, 0, 0));
|
||||
edit->setTextColor(RGB(0, 255, 0));
|
||||
edit->setWantFocus(0);
|
||||
|
||||
*cmdbuf = 0;
|
||||
edit->setBuffer(cmdbuf, 256);
|
||||
edit->init(this);
|
||||
|
||||
RECT r;
|
||||
POINT pt = {0, 0};
|
||||
Wasabi::Std::getViewport(&r, &pt);
|
||||
resize(r.right - 656, r.top + 16, 640, 480);
|
||||
bringToFront();
|
||||
}
|
||||
|
||||
for (int s = 0;s < jitd->getVSP();s++)
|
||||
{
|
||||
scriptVar v = WASABI_API_MAKIDEBUG->debugger_readStack(s);
|
||||
StringW str;
|
||||
switch (v.type)
|
||||
{
|
||||
case SCRIPT_VOID:
|
||||
str = L"NULL";
|
||||
break;
|
||||
case SCRIPT_INT:
|
||||
str = StringPrintfW(L"%d", GET_SCRIPT_INT(v));
|
||||
break;
|
||||
case SCRIPT_BOOLEAN:
|
||||
str = StringPrintfW(L"%s", GET_SCRIPT_BOOLEAN(v) ? L"true" : L"false");
|
||||
break;
|
||||
case SCRIPT_FLOAT:
|
||||
str = StringPrintfW(L"%f", GET_SCRIPT_FLOAT(v));
|
||||
break;
|
||||
case SCRIPT_DOUBLE:
|
||||
str = StringPrintfW(L"%f", (float)GET_SCRIPT_DOUBLE(v));
|
||||
break;
|
||||
case SCRIPT_STRING:
|
||||
str = GET_SCRIPT_STRING(v);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (v.type == SCRIPT_OBJECT)
|
||||
str = L"Object";
|
||||
else
|
||||
str = ObjectTable::getClassName(v.type);
|
||||
#ifdef WASABI_COMPILE_SKIN
|
||||
ScriptObject *o = GET_SCRIPT_OBJECT(v);
|
||||
if (o != NULL)
|
||||
{
|
||||
GuiObject *go = static_cast<GuiObject *>(o->vcpu_getInterface(guiObjectGuid));
|
||||
if (go != NULL)
|
||||
{
|
||||
str += L";";
|
||||
str.cat(go->guiobject_getId());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
strstack.addItem(new StringW(str));
|
||||
}
|
||||
|
||||
setVisible(1);
|
||||
|
||||
//WASABI_API_WND->pushModalWnd(this);
|
||||
|
||||
#ifdef WIN32
|
||||
MSG msg;
|
||||
//DWORD leavetime = GetTickCount()+5;
|
||||
while (!leave/* && !(GetTickCount() >leavetime)*/)
|
||||
{
|
||||
if (PeekMessage(&msg, /*(HWND)NULL*/ getOsWindowHandle(), 0, 0, PM_NOREMOVE))
|
||||
{
|
||||
GetMessage(&msg, /*(HWND) NULL*/getOsWindowHandle(), 0, 0) &&
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//WASABI_API_WND->popModalWnd(this);
|
||||
|
||||
setVisible(0);
|
||||
strstack.deleteAll();
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
int SimpleDebuggerUI::onPaint(Canvas *c)
|
||||
{
|
||||
SimpleDebuggerUI_PARENT::onPaint(c);
|
||||
Wasabi::FontInfo fontInfo;
|
||||
RECT r;
|
||||
getClientRect(&r);
|
||||
c->fillRect(&r, RGB(0, 0, 0));
|
||||
c->drawRect(&r, 1, RGB(0, 255, 0));
|
||||
|
||||
fontInfo.color = RGB(0, 255, 0);
|
||||
fontInfo.pointSize = 14;
|
||||
fontInfo.face = L"Courier New";
|
||||
c->pushPen(PENSTYLE_SOLID, 1, RGB(0, 255, 0));
|
||||
c->textOut(r.right - REGWIDTH + 7, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2) + 8, StringPrintfW(L"VSD:%08X", jitd->getVSD()), &fontInfo);
|
||||
c->textOut(r.right - REGWIDTH + 7, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2) + 8 + (LINEHEIGHT + 1), StringPrintfW(L"VIP:%08X", jitd->getVIP()), &fontInfo);
|
||||
c->textOut(r.right - REGWIDTH + 7, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2) + 8 + (LINEHEIGHT + 1)*2, StringPrintfW(L"VSP:%08X", jitd->getVSP()), &fontInfo);
|
||||
c->textOut(r.right - REGWIDTH + 7, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2) + 8 + (LINEHEIGHT + 1)*3, StringPrintfW(L"VCC:%08X", jitd->getVCC()), &fontInfo);
|
||||
c->lineDraw(r.left, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2), r.right, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2));
|
||||
c->lineDraw(r.left, r.bottom - (INPUTHEIGHT + 2), r.right - REGWIDTH, r.bottom - (INPUTHEIGHT + 2));
|
||||
c->lineDraw(r.right - REGWIDTH, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2), r.right - REGWIDTH, r.bottom);
|
||||
c->lineDraw(r.right - RIGHTCOLUMN, 0, r.right - RIGHTCOLUMN, r.bottom - (INPUTHEIGHT + (NCONSOLELINES*LINEHEIGHT) + 2));
|
||||
disassemble(c);
|
||||
for (int s = 0;s < strstack.getNumItems();s++)
|
||||
{
|
||||
c->textOutEllipsed(r.right - RIGHTCOLUMN + 4, s*LINEHEIGHT + 4, RIGHTCOLUMN - 8, 16, strstack.enumItem(s)->getValue(), &fontInfo);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SimpleDebuggerUI::onLeftButtonDown(int x, int y)
|
||||
{
|
||||
SimpleDebuggerUI_PARENT::onLeftButtonDown(x, y);
|
||||
if (edit) edit->onGetFocus();
|
||||
// leave = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::disassemble(Canvas *c)
|
||||
{
|
||||
RECT r;
|
||||
getClientRect(&r);
|
||||
int x = 4;
|
||||
|
||||
int y = (r.bottom - r.top - 4) / 2 + 4;
|
||||
|
||||
int ln = jitd->findLine(jitd->getVIP());
|
||||
if (ln != -1)
|
||||
{
|
||||
Wasabi::FontInfo fontInfo;
|
||||
SourceCodeLine *l = jitd->enumLine(ln);
|
||||
int sourcecode = l->getSourceFile() != NULL;
|
||||
int g;
|
||||
int j = 0;
|
||||
for (g = y;g < r.bottom - (INPUTHEIGHT + 4 + (NCONSOLELINES*LINEHEIGHT)) - LINEHEIGHT;g += LINEHEIGHT)
|
||||
{
|
||||
if (!sourcecode || j == 0)
|
||||
l = jitd->enumLine(ln + j);
|
||||
if (!l) break;
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
RECT br;
|
||||
br.left = 4;
|
||||
br.top = g;
|
||||
br.right = r.right - (RIGHTCOLUMN + 4);
|
||||
br.bottom = br.top + LINEHEIGHT;
|
||||
c->fillRect(&br, RGB(0, 255, 0));
|
||||
fontInfo.color = RGB(0, 0, 0);
|
||||
}
|
||||
if (!sourcecode)
|
||||
{
|
||||
String str;
|
||||
unsigned const char *d = (unsigned const char *)(l->getPointer() + jitd->getCodeBlock());
|
||||
for (int k = 0;k < l->getLength();k++)
|
||||
{
|
||||
if (!str.isempty()) str += " ";
|
||||
str += StringPrintf("%02X", *d);
|
||||
d++;
|
||||
}
|
||||
c->textOut(x, g, StringPrintfW(L"%08X", l->getPointer()), &fontInfo);
|
||||
c->textOut(x + 70, g, AutoWide(str), &fontInfo);
|
||||
c->textOut(x + 70 + 150, g, l->getLine(), &fontInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->textOutEllipsed(x, g, r.right - r.left - (RIGHTCOLUMN + 4 + x), 16, (getLine(l->getSourceFile(), l->getSourceFileLine() + j)), &fontInfo);
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
j = 1;
|
||||
for (g = y - LINEHEIGHT;g > 1;g -= LINEHEIGHT)
|
||||
{
|
||||
if (!sourcecode || j == 0)
|
||||
l = jitd->enumLine(ln - j);
|
||||
if (!l) break;
|
||||
if (!sourcecode)
|
||||
{
|
||||
String str;
|
||||
unsigned const char *d = (unsigned const char *)(l->getPointer() + jitd->getCodeBlock());
|
||||
for (int k = 0;k < l->getLength();k++)
|
||||
{
|
||||
if (!str.isempty()) str += " ";
|
||||
str += StringPrintf("%02X", *d);
|
||||
d++;
|
||||
}
|
||||
c->textOut(x, g, StringPrintfW(L"%08X", l->getPointer()), &fontInfo);
|
||||
c->textOut(x + 70, g, AutoWide(str), &fontInfo);
|
||||
c->textOut(x + 70 + 150, g, (l->getLine()), &fontInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->textOutEllipsed(x, g, r.right - r.left - (RIGHTCOLUMN + 4 + x), 16, (getLine(l->getSourceFile(), l->getSourceFileLine() - j)), &fontInfo);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int SimpleDebuggerUI::onResize()
|
||||
{
|
||||
SimpleDebuggerUI_PARENT::onResize();
|
||||
if (edit != NULL)
|
||||
{
|
||||
RECT r;
|
||||
getClientRect(&r);
|
||||
edit->resize(1, r.bottom - (INPUTHEIGHT + 1), r.right - r.left - (REGWIDTH + 1), INPUTHEIGHT);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SimpleDebuggerUI::childNotify(ifc_window *child, int msg, intptr_t p1, intptr_t p2)
|
||||
{
|
||||
if (child == edit)
|
||||
{
|
||||
if (msg == ChildNotify::EDITWND_ENTER_PRESSED)
|
||||
{
|
||||
onCommand(cmdbuf);
|
||||
}
|
||||
}
|
||||
return SimpleDebuggerUI_PARENT::childNotify(child, msg, p1, p2);
|
||||
}
|
||||
|
||||
BEGIN_STRINGDICTIONARY(_debuggercommands)
|
||||
SDI(L"b", DEBUG_CMD_BREAKPOINT);
|
||||
SDI(L"break", DEBUG_CMD_BREAKPOINT);
|
||||
SDI(L"x", DEBUG_CMD_CONTINUE);
|
||||
SDI(L"continue", DEBUG_CMD_CONTINUE);
|
||||
SDI(L"i", DEBUG_CMD_STEPINTO);
|
||||
SDI(L"stepinto", DEBUG_CMD_STEPINTO);
|
||||
SDI(L"o", DEBUG_CMD_STEPOVER);
|
||||
SDI(L"stepover", DEBUG_CMD_STEPOVER);
|
||||
SDI(L"p", DEBUG_CMD_STEPOUT);
|
||||
SDI(L"stepout", DEBUG_CMD_STEPOUT);
|
||||
SDI(L"k", DEBUG_CMD_KILL);
|
||||
SDI(L"kill", DEBUG_CMD_KILL);
|
||||
SDI(L"?", DEBUG_CMD_HELP);
|
||||
SDI(L"help", DEBUG_CMD_HELP);
|
||||
END_STRINGDICTIONARY(_debuggercommands, debuggercommands)
|
||||
|
||||
|
||||
void SimpleDebuggerUI::onCommand(const wchar_t *cmd)
|
||||
{
|
||||
if (*cmd == 0)
|
||||
{
|
||||
stepOver();
|
||||
return;
|
||||
}
|
||||
ParamParser pp(cmd, L" ");
|
||||
int i = debuggercommands.getId(pp.enumItem(0));
|
||||
switch (i)
|
||||
{
|
||||
case DEBUG_CMD_BREAKPOINT:
|
||||
addBreakPoint(pp.enumItem(1));
|
||||
break;
|
||||
case DEBUG_CMD_CONTINUE:
|
||||
continueExecution();
|
||||
break;
|
||||
case DEBUG_CMD_STEPINTO:
|
||||
stepInto();
|
||||
break;
|
||||
case DEBUG_CMD_STEPOVER:
|
||||
stepOver();
|
||||
break;
|
||||
case DEBUG_CMD_KILL:
|
||||
killScript();
|
||||
break;
|
||||
case DEBUG_CMD_HELP:
|
||||
showHelp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int SimpleDebuggerUI::evaluate(const wchar_t *ascii)
|
||||
{
|
||||
if (!_wcsicmp(ascii, L"VSD")) return jitd->getVSD();
|
||||
if (!_wcsicmp(ascii, L"VIP")) return jitd->getVIP();
|
||||
if (!_wcsicmp(ascii, L"VSP")) return jitd->getVSP();
|
||||
if (!_wcsicmp(ascii, L"VCC")) return jitd->getVCC();
|
||||
wchar_t *end;
|
||||
return wcstol(ascii, &end, 16);
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::addBreakPoint(const wchar_t *pointer_ascii)
|
||||
{
|
||||
/*int i = */evaluate(pointer_ascii);
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::continueExecution()
|
||||
{
|
||||
retcode = JITD_RETURN_CONTINUE;
|
||||
leave = 1;
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::stepInto()
|
||||
{
|
||||
retcode = JITD_RETURN_STEPINTO;
|
||||
leave = 1;
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::stepOver()
|
||||
{
|
||||
int ln = jitd->findLine(jitd->getVIP());
|
||||
ln++;
|
||||
SourceCodeLine *l = jitd->enumLine(ln);
|
||||
|
||||
if (l != NULL) // else ret as last opcode
|
||||
jitd->setSysBreakpoint(l->getPointer());
|
||||
|
||||
retcode = JITD_RETURN_CONTINUE;
|
||||
leave = 1;
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::killScript()
|
||||
{
|
||||
retcode = JITD_RETURN_TERMINATE;
|
||||
leave = 1;
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::showHelp()
|
||||
{}
|
||||
|
||||
int SimpleDebuggerUI::onGetFocus()
|
||||
{
|
||||
SimpleDebuggerUI_PARENT::onGetFocus();
|
||||
if (edit) edit->onGetFocus();
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SimpleDebuggerUI::onSetVisible(int show)
|
||||
{
|
||||
SimpleDebuggerUI_PARENT::onSetVisible(show);
|
||||
if (edit) edit->onGetFocus();
|
||||
}
|
||||
#undef fgets
|
||||
const wchar_t *SimpleDebuggerUI::getLine(const wchar_t *filename, int fileline)
|
||||
{
|
||||
if (fileline <= 0)
|
||||
return L"";
|
||||
static StringW str;
|
||||
FILE *f = _wfopen(filename, L"rt");
|
||||
if (!f)
|
||||
{
|
||||
str = L"couldn't load ";
|
||||
str += filename;
|
||||
return str;
|
||||
}
|
||||
|
||||
char t[256] = {0};
|
||||
char u[256] = {0};
|
||||
int n = fileline;
|
||||
while (n--)
|
||||
{
|
||||
*u = 0;
|
||||
char *p;
|
||||
do
|
||||
{
|
||||
p = *u ? t : u;
|
||||
fgets(p, 255, f);
|
||||
t[255] = 0;
|
||||
}
|
||||
while (!feof(f) && p[STRLEN(p)-1] != '\n' && p[STRLEN(p)-1] != '\r');
|
||||
}
|
||||
|
||||
char *p = u;
|
||||
while (p && *p && p < u + 256)
|
||||
{
|
||||
if (*p < 0x21) *p = ' ';
|
||||
p++;
|
||||
}
|
||||
|
||||
str = AutoWide(u, CP_UTF8);
|
||||
fclose(f);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
65
Src/Wasabi/api/script/debugger/sdebuggerui.h
Normal file
65
Src/Wasabi/api/script/debugger/sdebuggerui.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
#ifndef __SIMPLEDEBUGGERUI_H
|
||||
#define __SIMPLEDEBUGGERUI_H
|
||||
|
||||
#include "debuggerui.h"
|
||||
#include <api/wnd/wndclass/clickwnd.h>
|
||||
|
||||
class MakiDisassembler;
|
||||
class EditWnd;
|
||||
class String;
|
||||
class SourceCodeLine;
|
||||
|
||||
#define SimpleDebuggerUI_PARENT ClickWnd
|
||||
|
||||
enum {
|
||||
DEBUG_CMD_BREAKPOINT = 0,
|
||||
DEBUG_CMD_CONTINUE,
|
||||
DEBUG_CMD_STEPINTO,
|
||||
DEBUG_CMD_STEPOVER,
|
||||
DEBUG_CMD_STEPOUT,
|
||||
DEBUG_CMD_KILL,
|
||||
DEBUG_CMD_HELP,
|
||||
};
|
||||
|
||||
|
||||
class MakiJITD;
|
||||
|
||||
class SimpleDebuggerUI : public SimpleDebuggerUI_PARENT, public DebuggerUII {
|
||||
public:
|
||||
SimpleDebuggerUI();
|
||||
virtual ~SimpleDebuggerUI();
|
||||
|
||||
virtual int onPaint(Canvas *c);
|
||||
virtual int onLeftButtonDown(int x, int y);
|
||||
virtual int onResize();
|
||||
virtual int childNotify(ifc_window *child, int msg, intptr_t p1, intptr_t p2);
|
||||
virtual void onSetVisible(int show);
|
||||
|
||||
virtual int messageLoop();
|
||||
virtual void setJITD(MakiJITD *jitd);
|
||||
|
||||
virtual void disassemble(Canvas *c);
|
||||
virtual void onCommand(const wchar_t *cmd);
|
||||
|
||||
virtual void addBreakPoint(const wchar_t *pointer_ascii);
|
||||
virtual void continueExecution();
|
||||
virtual void stepInto();
|
||||
virtual void stepOver();
|
||||
virtual void killScript();
|
||||
virtual void showHelp();
|
||||
virtual int onGetFocus();
|
||||
|
||||
virtual int evaluate(const wchar_t *ascii);
|
||||
virtual const wchar_t *getLine(const wchar_t *filename, int fileline);
|
||||
|
||||
private:
|
||||
|
||||
int leave;
|
||||
MakiJITD *jitd;
|
||||
EditWnd *edit;
|
||||
wchar_t cmdbuf[256];
|
||||
int retcode;
|
||||
PtrList<StringW> strstack;
|
||||
};
|
||||
|
||||
#endif
|
69
Src/Wasabi/api/script/debugger/sourcecodeline.cpp
Normal file
69
Src/Wasabi/api/script/debugger/sourcecodeline.cpp
Normal file
|
@ -0,0 +1,69 @@
|
|||
#include <precomp.h>
|
||||
#include "sourcecodeline.h"
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
#define CBCLASS SourceCodeLineI
|
||||
START_DISPATCH;
|
||||
CB(SOURCECODELINE_GETLINE, getLine);
|
||||
VCB(SOURCECODELINE_SETLINE, setLine);
|
||||
CB(SOURCECODELINE_GETPOINTER, getPointer);
|
||||
VCB(SOURCECODELINE_SETPOINTER, setPointer);
|
||||
CB(SOURCECODELINE_GETLENGTH, getLength);
|
||||
VCB(SOURCECODELINE_SETLENGTH, setLength);
|
||||
VCB(SOURCECODELINE_SETSOURCEFILE, setSourceFile);
|
||||
CB(SOURCECODELINE_GETSOURCEFILE, getSourceFile);
|
||||
VCB(SOURCECODELINE_SETSOURCEFILELINE, setSourceFileLine);
|
||||
CB(SOURCECODELINE_GETSOURCEFILELINE, getSourceFileLine);
|
||||
END_DISPATCH;
|
||||
|
||||
SourceCodeLineI::SourceCodeLineI() {
|
||||
pointer = -1;
|
||||
fileline = -1;
|
||||
length = 0;
|
||||
}
|
||||
|
||||
SourceCodeLineI::~SourceCodeLineI() {
|
||||
}
|
||||
|
||||
const wchar_t *SourceCodeLineI::getLine()
|
||||
{
|
||||
return line;
|
||||
}
|
||||
|
||||
void SourceCodeLineI::setLine(const wchar_t *_line) {
|
||||
line = _line;
|
||||
}
|
||||
|
||||
int SourceCodeLineI::getPointer() {
|
||||
return pointer;
|
||||
}
|
||||
|
||||
void SourceCodeLineI::setPointer(int _pointer) {
|
||||
pointer = _pointer;
|
||||
}
|
||||
|
||||
int SourceCodeLineI::getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
void SourceCodeLineI::setLength(int _length) {
|
||||
length = _length;
|
||||
}
|
||||
|
||||
void SourceCodeLineI::setSourceFile(const wchar_t *_file) {
|
||||
file = _file;
|
||||
}
|
||||
|
||||
const wchar_t *SourceCodeLineI::getSourceFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
void SourceCodeLineI::setSourceFileLine(int _linenumber) {
|
||||
fileline = _linenumber;
|
||||
}
|
||||
|
||||
int SourceCodeLineI::getSourceFileLine() {
|
||||
return fileline;
|
||||
}
|
100
Src/Wasabi/api/script/debugger/sourcecodeline.h
Normal file
100
Src/Wasabi/api/script/debugger/sourcecodeline.h
Normal file
|
@ -0,0 +1,100 @@
|
|||
#ifndef __SOURCECODELINE_H
|
||||
#define __SOURCECODELINE_H
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <bfc/string/StringW.h>
|
||||
|
||||
|
||||
class SourceCodeLine : public Dispatchable {
|
||||
public:
|
||||
const wchar_t *getLine();
|
||||
void setLine(const wchar_t *line);
|
||||
int getPointer();
|
||||
void setPointer(int pointer);
|
||||
int getLength();
|
||||
void setLength(int length);
|
||||
void setSourceFile(const wchar_t *file);
|
||||
const wchar_t *getSourceFile();
|
||||
void setSourceFileLine(int linenumber);
|
||||
int getSourceFileLine();
|
||||
|
||||
enum {
|
||||
SOURCECODELINE_GETLINE = 0,
|
||||
SOURCECODELINE_SETLINE = 10,
|
||||
SOURCECODELINE_GETPOINTER = 20,
|
||||
SOURCECODELINE_SETPOINTER = 30,
|
||||
SOURCECODELINE_GETLENGTH = 40,
|
||||
SOURCECODELINE_SETLENGTH = 50,
|
||||
SOURCECODELINE_SETSOURCEFILE = 60,
|
||||
SOURCECODELINE_GETSOURCEFILE = 70,
|
||||
SOURCECODELINE_SETSOURCEFILELINE = 80,
|
||||
SOURCECODELINE_GETSOURCEFILELINE = 90,
|
||||
};
|
||||
};
|
||||
|
||||
inline const wchar_t *SourceCodeLine::getLine() {
|
||||
return _call(SOURCECODELINE_GETLINE, (const wchar_t*)NULL);
|
||||
}
|
||||
|
||||
inline void SourceCodeLine::setLine(const wchar_t *line) {
|
||||
_voidcall(SOURCECODELINE_SETLINE, line);
|
||||
}
|
||||
|
||||
inline int SourceCodeLine::getPointer() {
|
||||
return _call(SOURCECODELINE_GETPOINTER, (int)0);
|
||||
}
|
||||
|
||||
inline void SourceCodeLine::setPointer(int pointer) {
|
||||
_voidcall(SOURCECODELINE_SETPOINTER, pointer);
|
||||
}
|
||||
|
||||
inline int SourceCodeLine::getLength() {
|
||||
return _call(SOURCECODELINE_GETLENGTH, (int)0);
|
||||
}
|
||||
|
||||
inline void SourceCodeLine::setLength(int length) {
|
||||
_voidcall(SOURCECODELINE_SETLENGTH, length);
|
||||
}
|
||||
|
||||
inline void SourceCodeLine::setSourceFile(const wchar_t *file) {
|
||||
_voidcall(SOURCECODELINE_SETSOURCEFILE, file);
|
||||
}
|
||||
|
||||
inline const wchar_t *SourceCodeLine::getSourceFile() {
|
||||
return _call(SOURCECODELINE_GETSOURCEFILE, (const wchar_t *)0);
|
||||
}
|
||||
|
||||
inline void SourceCodeLine::setSourceFileLine(int linenumber) {
|
||||
_voidcall(SOURCECODELINE_SETSOURCEFILELINE, linenumber);
|
||||
}
|
||||
|
||||
inline int SourceCodeLine::getSourceFileLine() {
|
||||
return _call(SOURCECODELINE_GETSOURCEFILELINE, (int)0);
|
||||
}
|
||||
|
||||
class SourceCodeLineI : public SourceCodeLine {
|
||||
public:
|
||||
SourceCodeLineI();
|
||||
virtual ~SourceCodeLineI();
|
||||
virtual const wchar_t *getLine();
|
||||
virtual void setLine(const wchar_t *line);
|
||||
virtual int getPointer();
|
||||
virtual void setPointer(int pointer);
|
||||
virtual int getLength();
|
||||
virtual void setLength(int length);
|
||||
virtual void setSourceFile(const wchar_t *file);
|
||||
virtual const wchar_t *getSourceFile();
|
||||
virtual void setSourceFileLine(int linenumber);
|
||||
virtual int getSourceFileLine();
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
|
||||
StringW line;
|
||||
StringW file;
|
||||
int fileline;
|
||||
int pointer;
|
||||
int length;
|
||||
};
|
||||
|
||||
#endif
|
99
Src/Wasabi/api/script/debugger/vcpudebug.cpp
Normal file
99
Src/Wasabi/api/script/debugger/vcpudebug.cpp
Normal file
|
@ -0,0 +1,99 @@
|
|||
#include <precomp.h>
|
||||
#include <wasabicfg.h>
|
||||
#include "vcpudebug.h"
|
||||
#include <api/script/debugger/jitd.h>
|
||||
|
||||
VCPUDebugger::VCPUDebugger() {
|
||||
filter.setFilterObject(&reentryfilter);
|
||||
}
|
||||
|
||||
VCPUDebugger::~VCPUDebugger() {
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// instruction pointer
|
||||
int VCPUDebugger::getVIP() {
|
||||
return WASABI_API_MAKIDEBUG->debugger_getVIP();
|
||||
}
|
||||
|
||||
// script descriptor (vcpuid)
|
||||
int VCPUDebugger::getVSD() {
|
||||
return WASABI_API_MAKIDEBUG->debugger_getVSD();
|
||||
}
|
||||
|
||||
// variables stack pointer
|
||||
int VCPUDebugger::getVSP() {
|
||||
return WASABI_API_MAKIDEBUG->debugger_getVSP();
|
||||
}
|
||||
|
||||
// call stack pointer
|
||||
int VCPUDebugger::getVCC() {
|
||||
return WASABI_API_MAKIDEBUG->debugger_getVCC();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void VCPUDebugger::trace() {
|
||||
int i;
|
||||
for (i=0;i<jitds.getNumItems();i++) {
|
||||
MakiJITD *jitd = jitds.enumItem(i);
|
||||
if (jitd->getVCPUId() == getVSD()) {
|
||||
jitd->trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MakiJITD *VCPUDebugger::getJITD(int vcpuid) {
|
||||
int i;
|
||||
for (i=0;i<jitds.getNumItems();i++) {
|
||||
MakiJITD *jitd = jitds.enumItem(i);
|
||||
if (jitd->getVCPUId() == vcpuid)
|
||||
return jitd;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// if this returns 1, you should not call eventComplete!
|
||||
int VCPUDebugger::filterEvent(int vcpuid, int eventid) {
|
||||
MakiJITD *jitd = getJITD(vcpuid);
|
||||
if (!jitd || !jitd->isOnHold()) {
|
||||
WASABI_API_WND->pushModalWnd();
|
||||
scopestack.push(0);
|
||||
return 0;
|
||||
}
|
||||
filter.enterScope((vcpuid<<16) + eventid); // (vcpuid<<16) + eventid
|
||||
if (filter.mustLeave()) {
|
||||
filter.leaveScope();
|
||||
return 1;
|
||||
}
|
||||
WASABI_API_WND->pushModalWnd();
|
||||
scopestack.push(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void VCPUDebugger::eventComplete() {
|
||||
int n;
|
||||
scopestack.pop(&n);
|
||||
WASABI_API_WND->popModalWnd();
|
||||
if (n) {
|
||||
filter.leaveScope();
|
||||
}
|
||||
}
|
||||
|
||||
int VCPUDebugger::isActive() {
|
||||
foreach(jitds)
|
||||
if (jitds.getfor()->isActive())
|
||||
return 1;
|
||||
endfor;
|
||||
return 0;
|
||||
}
|
||||
|
||||
MakiJITD *VCPUDebugger::createJITD(int vcpuid) {
|
||||
MakiJITD *jitd = new MakiJITD(this, vcpuid);
|
||||
jitds.addItem(jitd);
|
||||
return jitd;
|
||||
}
|
||||
|
||||
const char *VCPUDebugger::getCodeBlock(int vcpuid) {
|
||||
return WASABI_API_MAKIDEBUG->debugger_getCodeBlock(vcpuid);
|
||||
}
|
39
Src/Wasabi/api/script/debugger/vcpudebug.h
Normal file
39
Src/Wasabi/api/script/debugger/vcpudebug.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
#ifndef __VCPUDEBUG_H
|
||||
#define __VCPUDEBUG_H
|
||||
|
||||
#include <bfc/ptrlist.h>
|
||||
#include <bfc/stack.h>
|
||||
#include <bfc/reentryfilter.h>
|
||||
|
||||
class MakiJITD;
|
||||
|
||||
class VCPUDebugger {
|
||||
public:
|
||||
VCPUDebugger();
|
||||
virtual ~VCPUDebugger();
|
||||
|
||||
void trace();
|
||||
|
||||
int getVIP(); // instruction pointer
|
||||
int getVSD(); // script descriptor (id)
|
||||
int getVSP(); // variables stack pointer
|
||||
int getVCC(); // call stack pointer
|
||||
|
||||
int filterEvent(int vcpuid, int eventid); // if this returns 1, you should return immediatly and not call eventComplete!
|
||||
void eventComplete();
|
||||
|
||||
int isActive();
|
||||
|
||||
MakiJITD *createJITD(int vcpuid);
|
||||
MakiJITD *getJITD(int vcpuid);
|
||||
const char *getCodeBlock(int vcpuid);
|
||||
|
||||
private:
|
||||
|
||||
PtrList<MakiJITD> jitds;
|
||||
ReentryFilterObject reentryfilter;
|
||||
ReentryFilter filter;
|
||||
Stack<int> scopestack;
|
||||
};
|
||||
|
||||
#endif
|
216
Src/Wasabi/api/script/guru.cpp
Normal file
216
Src/Wasabi/api/script/guru.cpp
Normal file
|
@ -0,0 +1,216 @@
|
|||
#include <precomp.h>
|
||||
#include <api.h>
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
#include <api/wnd/basewnd.h>
|
||||
#include <tataki/canvas/bltcanvas.h>
|
||||
#endif
|
||||
#include <api/script/guru.h>
|
||||
#include <api/script/script.h>
|
||||
#include <api/script/vcpu.h>
|
||||
#ifdef WASABI_COMPILE_SKIN
|
||||
#include <api/skin/skin.h>
|
||||
#endif
|
||||
|
||||
extern HINSTANCE hInstance;
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
Guru::Guru()
|
||||
{
|
||||
fcount = 0;
|
||||
txt=NULL;
|
||||
code=0;
|
||||
intinfo=0;
|
||||
}
|
||||
|
||||
Guru::~Guru() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void Guru::spawn(SystemObject *_script, int code, const wchar_t *pub, int intinfo) {
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
script = _script;
|
||||
if (WASABI_API_PALETTE->getSkinPartIterator() > last_iterator) {
|
||||
mustquit = 0;
|
||||
last_iterator = WASABI_API_PALETTE->getSkinPartIterator();
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
#ifdef WASABI_COMPILE_SKIN
|
||||
int oldlock = WASABI_API_SKIN->skin_getLockUI();
|
||||
WASABI_API_SKIN->skin_setLockUI(0);
|
||||
#endif
|
||||
|
||||
Guru g;
|
||||
g.setCode(code);
|
||||
g.setPublicTxt(pub);
|
||||
g.setIntInfo(intinfo);
|
||||
g.setStartHidden(1);
|
||||
g.init(hInstance, INVALIDOSWINDOWHANDLE, TRUE);
|
||||
|
||||
RECT r;
|
||||
Wasabi::Std::getViewport(&r, (POINT*)NULL);
|
||||
|
||||
r.left = r.left + ((r.right-r.left-640)/2);
|
||||
r.right = r.left + 640;
|
||||
TextInfoCanvas c(&g);
|
||||
Wasabi::FontInfo fontInfo;
|
||||
fontInfo.pointSize = WASABI_API_APP->getScaleY(14);
|
||||
|
||||
#ifdef WIN32
|
||||
fontInfo.face = L"Lucida Console";
|
||||
#else
|
||||
fontInfo.face = L"Lucida";
|
||||
#endif
|
||||
fontInfo.bold = true;
|
||||
|
||||
r.bottom = r.top + c.getTextHeight(&fontInfo)* (script != NULL ? 9 : 7);
|
||||
|
||||
g.resize(&r);
|
||||
g.setVisible(1);
|
||||
g.bringToFront();
|
||||
|
||||
MSG msg = {0};
|
||||
WASABI_API_WND->pushModalWnd(&g);
|
||||
#ifdef WIN32
|
||||
HWND old = SetCapture(g.gethWnd());
|
||||
#endif
|
||||
while (!mustquit) {
|
||||
mustquit = !GetMessage(&msg, g.gethWnd(), 0, 0);
|
||||
#ifdef WIN32
|
||||
if (!msg.hwnd || !TranslateAccelerator(msg.hwnd, NULL, &msg)) {
|
||||
#endif
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
#ifdef WIN32
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
WASABI_API_WND->popModalWnd(&g);
|
||||
#ifdef WIN32
|
||||
SetCapture(old);
|
||||
#endif
|
||||
|
||||
#else
|
||||
StringPrintfW t(L"Guru Meditation #%04X.%04X%04X.%d%s%s", code, (intinfo & 0xFFFF), VCPU::VIP & 0xFFFF, VCPU::VSD, pub?" ":"", pub?pub:"");
|
||||
Std::messageBox(t, L"Guru Meditiation", 16);
|
||||
#endif
|
||||
|
||||
#ifdef WASABI_COMPILE_SKIN
|
||||
WASABI_API_SKIN->skin_setLockUI(oldlock);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
|
||||
int Guru::onPaint(Canvas *canvas) {
|
||||
|
||||
GURU_PARENT::onPaint(canvas);
|
||||
|
||||
PaintBltCanvas paintcanvas;
|
||||
if (canvas == NULL) {
|
||||
paintcanvas.beginPaint(this);
|
||||
canvas = &paintcanvas;
|
||||
}
|
||||
|
||||
RECT r;
|
||||
getClientRect(&r);
|
||||
|
||||
canvas->fillRect(&r, 0);
|
||||
|
||||
if (fcount%2==0)
|
||||
{
|
||||
int w;
|
||||
Wasabi::FontInfo fontInfo;
|
||||
fontInfo.color = RGB(0xFF,0,0);
|
||||
fontInfo.pointSize = WASABI_API_APP->getScaleY(14);
|
||||
|
||||
#ifdef WIN32
|
||||
fontInfo.face = L"Lucida Console";
|
||||
#else
|
||||
fontInfo.face = L"Lucida";
|
||||
#endif
|
||||
fontInfo.bold = true;
|
||||
fontInfo.opaque = false;
|
||||
w = canvas->getTextHeight(&fontInfo);
|
||||
RECT s = {40, w*2, 560, w*3};
|
||||
canvas->textOutCentered(&s, L"Winamp Script Failure. Press the left mouse button to continue.", &fontInfo);
|
||||
StringPrintfW t(L"Guru Meditation #%04X.%04X%04X.%d%s%s", code, (intinfo & 0xFFFF), VCPU::VIP & 0xFFFF, VCPU::VSD, txt?L" ":L"", txt?txt:L"");
|
||||
s.top=w*4;
|
||||
s.bottom=s.top+w;
|
||||
canvas->textOutCentered(&s, t, &fontInfo);
|
||||
|
||||
if (script != NULL) {
|
||||
s.top=w*6;
|
||||
s.bottom=s.top+w;
|
||||
canvas->textOutCentered(&s, script->getFilename(), &fontInfo);
|
||||
}
|
||||
|
||||
RECT z;
|
||||
z.top = r.top + 5;
|
||||
z.bottom = r.top + min(10, w-2);
|
||||
z.left = r.left + 5;
|
||||
z.right = r.right - 5;
|
||||
canvas->fillRect(&z, RGB(0xFF,0,0));
|
||||
|
||||
z.top = r.top + 5;
|
||||
z.bottom = r.bottom - 5;;
|
||||
z.left = r.right - min(10, w-2);
|
||||
z.right = r.right - 5;
|
||||
canvas->fillRect(&z, RGB(0xFF,0,0));
|
||||
|
||||
z.top = r.bottom - min(10, w-2);
|
||||
z.bottom = r.bottom - 5;
|
||||
z.left = r.left + 5;
|
||||
z.right = r.right - 5;
|
||||
canvas->fillRect(&z, RGB(0xFF,0,0));
|
||||
|
||||
z.top = r.top + 5;
|
||||
z.bottom = r.bottom - 5;;
|
||||
z.left = r.left + 5;
|
||||
z.right = r.left + min(10, w-2);
|
||||
canvas->fillRect(&z, RGB(0xFF,0,0));
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Guru::onLeftButtonUp(int x, int y) {
|
||||
mustquit=1;
|
||||
return GURU_PARENT::onLeftButtonUp(x,y);
|
||||
}
|
||||
|
||||
int Guru::onInit() {
|
||||
GURU_PARENT::onInit();
|
||||
setTimer(GURU_TIMERID, 400);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Guru::setCode(int c) {
|
||||
code = c;
|
||||
}
|
||||
|
||||
void Guru::setPublicTxt(const wchar_t *t) {
|
||||
txt = t;
|
||||
}
|
||||
|
||||
void Guru::setIntInfo(int info) {
|
||||
intinfo = info;
|
||||
}
|
||||
|
||||
void Guru::timerCallback(int id) {
|
||||
if (id == GURU_TIMERID) {
|
||||
fcount++;
|
||||
if (fcount > 7) {
|
||||
killTimer(GURU_TIMERID);
|
||||
}
|
||||
invalidate();
|
||||
return;
|
||||
}
|
||||
GURU_PARENT::timerCallback(id);
|
||||
}
|
||||
|
||||
int Guru::mustquit = 0;
|
||||
int Guru::last_iterator = -1;
|
||||
SystemObject * Guru::script = NULL;
|
||||
#endif
|
51
Src/Wasabi/api/script/guru.h
Normal file
51
Src/Wasabi/api/script/guru.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
//PORTABLE
|
||||
#ifndef _GURU_H
|
||||
#define _GURU_H
|
||||
|
||||
#include <api/wnd/basewnd.h>
|
||||
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
#define GURU_PARENT BaseWnd
|
||||
#else
|
||||
class _Guru {};
|
||||
#define GURU_PARENT _Guru
|
||||
#endif
|
||||
|
||||
class SystemObject;
|
||||
|
||||
#define GURU_TIMERID 2482
|
||||
|
||||
class Guru : public GURU_PARENT {
|
||||
public:
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
Guru();
|
||||
virtual ~Guru();
|
||||
#endif
|
||||
|
||||
static void spawn(SystemObject *_script, int code, const wchar_t *pub = NULL, int intinfo = 0);
|
||||
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
virtual int onPaint(Canvas *canvas);
|
||||
virtual int onLeftButtonUp(int x, int y);
|
||||
virtual int onInit();
|
||||
void setCode(int c);
|
||||
void setPublicTxt(const wchar_t *t);
|
||||
void setIntInfo(int info);
|
||||
#endif
|
||||
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
protected:
|
||||
virtual void timerCallback(int id);
|
||||
|
||||
private:
|
||||
int code;
|
||||
const wchar_t *txt;
|
||||
int fcount;
|
||||
int intinfo;
|
||||
static int mustquit;
|
||||
static int last_iterator;
|
||||
static SystemObject * script;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
248
Src/Wasabi/api/script/makiapi.cpp
Normal file
248
Src/Wasabi/api/script/makiapi.cpp
Normal file
|
@ -0,0 +1,248 @@
|
|||
#include "precomp.h"
|
||||
#include "makiapi.h"
|
||||
#include "../../studio/api.h"
|
||||
#include "../../bfc/api/api_maki.h"
|
||||
#include "../../studio/script/vcpu.h"
|
||||
#include "../../studio/script/objecttable.h"
|
||||
#include "../../studio/script/scriptmgr.h"
|
||||
#include "../../studio/script/script.h"
|
||||
#include "../../common/script/scriptobj.h"
|
||||
|
||||
api_maki *makiApi = NULL;
|
||||
|
||||
ScriptApi::ScriptApi() {
|
||||
ObjectTable::loadExternalClasses();
|
||||
VCPU::scriptManager = new ScriptObjectManager();
|
||||
}
|
||||
|
||||
ScriptApi::~ScriptApi() {
|
||||
delete VCPU::scriptManager;
|
||||
VCPU::scriptManager = NULL;
|
||||
VCPU::shutdown();
|
||||
ObjectTable::unloadExternalClasses();
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushObject(void *o) {
|
||||
VCPU::pushObject(o);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushInt(int i) {
|
||||
VCPU::pushInt(i);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushBoolean(int b) {
|
||||
VCPU::pushBoolean(b);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushFloat(float f) {
|
||||
VCPU::pushFloat(f);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushDouble(double d) {
|
||||
VCPU::pushDouble(d);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushString(const char *s) {
|
||||
VCPU::pushString(s);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushAny(scriptVar v) {
|
||||
VCPU::push(v);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_pushVoid() {
|
||||
VCPU::pushVoid();
|
||||
}
|
||||
|
||||
void *ScriptApi::maki_popObject() {
|
||||
return VCPU::popObject();
|
||||
}
|
||||
|
||||
int ScriptApi::maki_popInt() {
|
||||
return VCPU::popInt();
|
||||
}
|
||||
|
||||
bool ScriptApi::maki_popBoolean() {
|
||||
return VCPU::popBoolean();
|
||||
}
|
||||
|
||||
float ScriptApi::maki_popFloat() {
|
||||
return VCPU::popFloat();
|
||||
}
|
||||
|
||||
double ScriptApi::maki_popDouble() {
|
||||
return VCPU::popDouble();
|
||||
}
|
||||
|
||||
const char *ScriptApi::maki_popString() {
|
||||
return VCPU::popString();
|
||||
}
|
||||
|
||||
scriptVar ScriptApi::maki_popAny() {
|
||||
return VCPU::pop().v;
|
||||
}
|
||||
|
||||
void ScriptApi::maki_popDiscard() {
|
||||
VCPU::popDiscard();
|
||||
}
|
||||
|
||||
const char *ScriptApi::maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p) {
|
||||
return ObjectTable::getFunction(dlfid, nparams, p);
|
||||
}
|
||||
|
||||
int ScriptApi::maki_addDlfRef(ScriptObjectController *o, const char *function_name, void *host) {
|
||||
return ObjectTable::dlfAddRef(o, function_name, host);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_remDlfRef(void *host) {
|
||||
ObjectTable::dlfRemRef(host);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_addDlfClassRef(ScriptObjectController *o, void *host) {
|
||||
ObjectTable::dlfAddClassRef(o, host);
|
||||
}
|
||||
|
||||
scriptVar ScriptApi::maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params) {
|
||||
return ObjectTable::callFunction(o, dlfid, params);
|
||||
}
|
||||
|
||||
scriptVar ScriptApi::maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid) {
|
||||
scriptVar v = MAKE_SCRIPT_OBJECT(o);
|
||||
return VCPU::executeEvent(v, dlfid, np, scriptid);
|
||||
}
|
||||
|
||||
ScriptObject *ScriptApi::maki_instantiate(GUID classguid) {
|
||||
int classid = ObjectTable::getClassFromGuid(classguid);
|
||||
if (classid == -1) return NULL;
|
||||
return ObjectTable::instantiate(classid);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_destroy(ScriptObject *o) {
|
||||
ObjectTable::destroy(o);
|
||||
}
|
||||
|
||||
void *ScriptApi::maki_encapsulate(GUID classguid, ScriptObject *o) {
|
||||
int classid = ObjectTable::getClassFromGuid(classguid);
|
||||
if (classid == -1) return NULL;
|
||||
return ObjectTable::encapsulate(classid, o);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_deencapsulate(GUID classguid, void *o) {
|
||||
int classid = ObjectTable::getClassFromGuid(classguid);
|
||||
if (classid == -1) return;
|
||||
ObjectTable::deencapsulate(classid, o);
|
||||
}
|
||||
|
||||
ScriptObjectController *ScriptApi::maki_getController(GUID scriptclass) {
|
||||
return ObjectTable::getController(scriptclass);
|
||||
}
|
||||
int ScriptApi::maki_createOrphan(int type) {
|
||||
return VCPU::createOrphan(type);
|
||||
}
|
||||
|
||||
void ScriptApi::maki_killOrphan(int id) {
|
||||
VCPU::killOrphan(id);
|
||||
}
|
||||
|
||||
int ScriptApi::maki_getScriptInt(scriptVar v) {
|
||||
return SOM::makeInt(&v);
|
||||
}
|
||||
|
||||
bool ScriptApi::maki_getScriptBoolean(scriptVar v) {
|
||||
return SOM::makeBoolean(&v);
|
||||
}
|
||||
|
||||
float ScriptApi::maki_getScriptFloat(scriptVar v) {
|
||||
return SOM::makeFloat(&v);
|
||||
}
|
||||
|
||||
double ScriptApi::maki_getScriptDouble(scriptVar v) {
|
||||
return SOM::makeDouble(&v);
|
||||
}
|
||||
|
||||
const char *ScriptApi::maki_getScriptString(scriptVar v) {
|
||||
ASSERT(v.type == SCRIPT_STRING);
|
||||
return v.data.sdata;
|
||||
}
|
||||
|
||||
ScriptObject *ScriptApi::maki_getScriptObject(scriptVar v) {
|
||||
ASSERT(!SOM::isNumeric(&v) && v.type != SCRIPT_STRING);
|
||||
return v.data.odata;
|
||||
}
|
||||
|
||||
scriptVar ScriptApi::maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount) {
|
||||
switch (cmd->cmd) {
|
||||
case MAKI_CMD_ADDREF:
|
||||
(*linkcount)++;
|
||||
break;
|
||||
case MAKI_CMD_REMREF:
|
||||
(*linkcount)--;
|
||||
ASSERT(*linkcount >= 0);
|
||||
if (*linkcount == 0)
|
||||
*dlfid = -1;
|
||||
break;
|
||||
case MAKI_CMD_SETDLF:
|
||||
ASSERT(*dlfid == -1);
|
||||
*dlfid = cmd->id;
|
||||
break;
|
||||
case MAKI_CMD_GETDLF:
|
||||
cmd->id = *dlfid;
|
||||
break;
|
||||
}
|
||||
RETURN_SCRIPT_VOID
|
||||
}
|
||||
|
||||
void ScriptApi::maki_setObjectAtom(const char *atomname, ScriptObject *object) {
|
||||
VCPU::setAtom(atomname, object);
|
||||
}
|
||||
|
||||
ScriptObject *ScriptApi::maki_getObjectAtom(const char *atomname) {
|
||||
return VCPU::getAtom(atomname);
|
||||
}
|
||||
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
ScriptObject *ScriptApi::maki_findObject(const char *name) {
|
||||
return ScriptObjectManager::findObject(name);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ScriptApi::vcpu_addScriptObject(ScriptObject *o) {
|
||||
SystemObject::addScriptObject(o);
|
||||
}
|
||||
|
||||
void ScriptApi::vcpu_removeScriptObject(ScriptObject *o) {
|
||||
SystemObject::removeScriptObject(o);
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_getCacheCount() {
|
||||
return Script::getCacheCount();
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_isValidScriptId(int id) {
|
||||
return Script::isValidScriptId(id);
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_mapVarId(int varid, int scriptid) {
|
||||
return Script::varIdToGlobal(varid, scriptid);
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_getUserAncestorId(int varid, int scriptid) {
|
||||
return Script::getUserAncestor(varid, scriptid);
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_getNumEvents() {
|
||||
return Script::getNumEventsLinked();
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_getEvent(int event, int *dlf, int *script, int *var) {
|
||||
return Script::getLinkedEventParams(event, dlf, script, var);
|
||||
}
|
||||
|
||||
int ScriptApi::vcpu_getComplete() {
|
||||
return VCPU::getComplete();
|
||||
}
|
||||
|
||||
const char * ScriptApi::vcpu_getClassName(int vcpuid, int localclassid) {
|
||||
return VCPU::getClassName(vcpuid, localclassid);
|
||||
}
|
||||
|
66
Src/Wasabi/api/script/makiapi.h
Normal file
66
Src/Wasabi/api/script/makiapi.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
#ifndef __SCRIPTAPI_H
|
||||
#define __SCRIPTAPI_H
|
||||
|
||||
#include <api/script/api_makii.h>
|
||||
|
||||
class ScriptApi : public api_makiI {
|
||||
public:
|
||||
ScriptApi();
|
||||
virtual ~ScriptApi();
|
||||
|
||||
virtual void maki_pushObject(void *o);
|
||||
virtual void maki_pushInt(int v);
|
||||
virtual void maki_pushBoolean(int b);
|
||||
virtual void maki_pushFloat(float f);
|
||||
virtual void maki_pushDouble(double d);
|
||||
virtual void maki_pushString(const wchar_t *s);
|
||||
virtual void maki_pushVoid();
|
||||
virtual void maki_pushAny(scriptVar v);
|
||||
virtual void *maki_popObject();
|
||||
virtual int maki_popInt();
|
||||
virtual bool maki_popBoolean();
|
||||
virtual float maki_popFloat();
|
||||
virtual double maki_popDouble();
|
||||
virtual const wchar_t *maki_popString();
|
||||
virtual scriptVar maki_popAny();
|
||||
virtual void maki_popDiscard();
|
||||
virtual const wchar_t *maki_getFunction(int dlfid, int *n, ScriptObjectController **p);
|
||||
virtual int maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host);
|
||||
virtual void maki_addDlfClassRef(ScriptObjectController *o, void *host);
|
||||
virtual void maki_remDlfRef(void *host);
|
||||
virtual scriptVar maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params);
|
||||
virtual scriptVar maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid0=-1);
|
||||
virtual int maki_getScriptInt(scriptVar v);
|
||||
virtual bool maki_getScriptBoolean(scriptVar v);
|
||||
virtual float maki_getScriptFloat(scriptVar v);
|
||||
virtual double maki_getScriptDouble(scriptVar v);
|
||||
virtual const wchar_t *maki_getScriptString(scriptVar v);
|
||||
virtual ScriptObject *maki_getScriptObject(scriptVar v);
|
||||
virtual scriptVar maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount);
|
||||
virtual ScriptObject *maki_instantiate(GUID classguid);
|
||||
virtual void maki_destroy(ScriptObject *o);
|
||||
virtual void *maki_encapsulate(GUID classguid, ScriptObject *o);
|
||||
virtual void maki_deencapsulate(GUID classguid, void *o);
|
||||
virtual ScriptObjectController *maki_getController(GUID scriptclass);
|
||||
virtual int maki_createOrphan(int type);
|
||||
virtual void maki_killOrphan(int id);
|
||||
virtual void maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object);
|
||||
virtual ScriptObject *maki_getObjectAtom(const wchar_t *atomname);
|
||||
#ifdef WASABI_COMPILE_WND
|
||||
virtual ScriptObject *maki_findObject(const wchar_t *name);
|
||||
#endif
|
||||
virtual void vcpu_addScriptObject(ScriptObject *o);
|
||||
virtual void vcpu_removeScriptObject(ScriptObject *o);
|
||||
virtual int vcpu_getCacheCount();
|
||||
virtual int vcpu_isValidScriptId(int id);
|
||||
virtual int vcpu_mapVarId(int varid, int scriptid);
|
||||
virtual int vcpu_getUserAncestorId(int varid, int scriptid);
|
||||
virtual int vcpu_getNumEvents();
|
||||
virtual int vcpu_getEvent(int event, int *dlf, int *script, int *var);
|
||||
virtual int vcpu_getComplete();
|
||||
virtual const wchar_t *vcpu_getClassName(int vcpuid, int localclassid);
|
||||
};
|
||||
|
||||
extern api_maki *makiApi;
|
||||
|
||||
#endif
|
156
Src/Wasabi/api/script/objcontroller.cpp
Normal file
156
Src/Wasabi/api/script/objcontroller.cpp
Normal file
|
@ -0,0 +1,156 @@
|
|||
#include <bfc/wasabi_std.h>
|
||||
#include <api/script/objcontroller.h>
|
||||
#include <api/script/objects/c_script/scripthook.h>
|
||||
#include "api.h"
|
||||
|
||||
#define CBCLASS ScriptObjectControllerI
|
||||
START_DISPATCH;
|
||||
CB(GETCLASSGUID, getClassGuid);
|
||||
CB(GETCLASSNAME, getClassName);
|
||||
CB(GETANCESTORCLASSNAME, getAncestorClassName);
|
||||
CB(GETNUMFUNCTIONS, getNumFunctions);
|
||||
CB(GETEXPORTEDFUNCTIONS, getExportedFunctions);
|
||||
CB(INSTANTIATE, instantiate);
|
||||
VCB(DESTROY, destroy);
|
||||
CB(ENCAPSULATE, encapsulate);
|
||||
VCB(DEENCAPSULATE, deencapsulate);
|
||||
VCB(SETCLASSID, setClassId);
|
||||
CB(GETCLASSID, getClassId);
|
||||
VCB(SETANCESTORCLASSID, setAncestorClassId);
|
||||
CB(GETANCESTORCLASSID, getAncestorClassId);
|
||||
CB(GETINSTANTIABLE, getInstantiable);
|
||||
CB(GETREFERENCEABLE, getReferenceable);
|
||||
CB(GETANCESTORCONTROLLER, getAncestorController);
|
||||
VCB(ADDCLASSHOOK, addClassHook);
|
||||
VCB(ADDOBJHOOK, addObjectHook);
|
||||
VCB(REMHOOKS, removeHooks);
|
||||
VCB(ONREGISTERCLASS, onRegisterClass);
|
||||
CB(CAST, cast);
|
||||
END_DISPATCH;
|
||||
|
||||
ScriptObjectControllerI::ScriptObjectControllerI() {
|
||||
my_class_id = -1;
|
||||
my_ancestor_class_id = -1;
|
||||
rootController = NULL;
|
||||
incast = 0;
|
||||
}
|
||||
|
||||
ScriptObjectControllerI::~ScriptObjectControllerI() {
|
||||
}
|
||||
|
||||
int ScriptObjectControllerI::processHooks(ScriptObject *o, int dlfid, scriptVar **table, int nparams) {
|
||||
//CUT: int n=-1;
|
||||
for (int j=0;j<classhooks.getNumItems();j++) {
|
||||
classhooks.enumItem(j)->eventCallback(o, dlfid, table, nparams);
|
||||
}
|
||||
for (int i=0;i<objhooks.getNumItems();i++) {
|
||||
object_hook_struct *s = objhooks.enumItem(i);
|
||||
if (s->object == o) {
|
||||
s->hook->eventCallback(o, dlfid, table, nparams);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ScriptObject *ScriptObjectControllerI::cast(ScriptObject *o, GUID g) {
|
||||
if (incast) return NULL;
|
||||
incast = 1;
|
||||
ASSERT(o != NULL);
|
||||
ScriptObject *obj = NULL;
|
||||
void *i = o->vcpu_getInterfaceObject(g, &obj);
|
||||
incast = 0;
|
||||
if (i != NULL) {
|
||||
if (obj != NULL) return obj;
|
||||
return o;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ScriptObjectControllerI::addClassHook(ScriptHook *h) {
|
||||
classhooks.addItem(h);
|
||||
}
|
||||
|
||||
void ScriptObjectControllerI::addObjectHook(ScriptHook *h, ScriptObject *o) {
|
||||
object_hook_struct *s = new object_hook_struct;
|
||||
s->hook = h;
|
||||
s->object = o;
|
||||
objhooks.addItem(s);
|
||||
/* if (getAncestorController())
|
||||
getAncestorController()->addObjectHook(h, o);
|
||||
else
|
||||
if (rootController && this != rootController) rootController->addObjectHook(h, o);*/
|
||||
}
|
||||
|
||||
void ScriptObjectControllerI::removeHooks(ScriptHook *h) {
|
||||
classhooks.removeItem(h);
|
||||
for (int i=0;i<objhooks.getNumItems();i++) {
|
||||
object_hook_struct *o = objhooks.enumItem(i);
|
||||
if (o->hook == h) {
|
||||
delete o;
|
||||
objhooks.removeByPos(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
/* if (getAncestorController())
|
||||
getAncestorController()->removeHooks(h);
|
||||
else
|
||||
if (rootController && this != rootController) rootController->removeHooks(h);*/
|
||||
}
|
||||
|
||||
void ScriptObjectControllerI::onRegisterClass(ScriptObjectController *root) {
|
||||
rootController = root;
|
||||
}
|
||||
|
||||
|
||||
scriptVar MAKE_SCRIPT_INT(int i) {
|
||||
scriptVar r;
|
||||
r.type = SCRIPT_INT;
|
||||
r.data.idata = i;
|
||||
return r;
|
||||
}
|
||||
|
||||
scriptVar MAKE_SCRIPT_VOID() {
|
||||
scriptVar r; r.type = SCRIPT_VOID;
|
||||
r.data.idata = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
scriptVar MAKE_SCRIPT_FLOAT(float f) {
|
||||
scriptVar r; r.type = SCRIPT_FLOAT;
|
||||
r.data.fdata = f;
|
||||
return r;
|
||||
}
|
||||
|
||||
scriptVar MAKE_SCRIPT_DOUBLE(double d) {
|
||||
scriptVar r; r.type = SCRIPT_DOUBLE;
|
||||
r.data.ddata = d;
|
||||
return r;
|
||||
}
|
||||
|
||||
scriptVar MAKE_SCRIPT_BOOLEAN(int b) {
|
||||
scriptVar r; r.type = SCRIPT_BOOLEAN;
|
||||
r.data.idata = b;
|
||||
return r;
|
||||
}
|
||||
|
||||
scriptVar MAKE_SCRIPT_OBJECT(ScriptObject *o) {
|
||||
scriptVar r;
|
||||
r.type = SCRIPT_OBJECT;
|
||||
r.data.odata = o;
|
||||
return r;
|
||||
}
|
||||
|
||||
scriptVar MAKE_SCRIPT_STRING(const wchar_t *s)
|
||||
{
|
||||
scriptVar r;
|
||||
r.type = SCRIPT_STRING;
|
||||
r.data.sdata = s;
|
||||
return r;
|
||||
}
|
||||
|
||||
void *GET_SCRIPT_OBJECT_AS(scriptVar v, GUID g) {
|
||||
ScriptObject *o = GET_SCRIPT_OBJECT(v);
|
||||
if (!o) return NULL;
|
||||
return o->vcpu_getInterface(g);
|
||||
}
|
||||
|
316
Src/Wasabi/api/script/objcontroller.h
Normal file
316
Src/Wasabi/api/script/objcontroller.h
Normal file
|
@ -0,0 +1,316 @@
|
|||
#ifndef __SCRIPTOBJECTCONTROLLER_H
|
||||
#define __SCRIPTOBJECTCONTROLLER_H
|
||||
|
||||
#include <api/script/scriptguid.h>
|
||||
|
||||
//#include <wasabicfg.h>
|
||||
|
||||
#include <bfc/ptrlist.h>
|
||||
#include <bfc/dispatch.h>
|
||||
#include <api/script/scriptobj.h>
|
||||
#include <api/script/vcputypes.h>
|
||||
#include <api/service/svcs/svc_scriptobj.h>
|
||||
|
||||
#define SCRIPT_MAXARGS 10 // 10 args max per function
|
||||
|
||||
#define MAKI_CMD_NONE 0
|
||||
#define MAKI_CMD_SETDLF 1
|
||||
#define MAKI_CMD_GETDLF 2
|
||||
#define MAKI_CMD_ADDREF 3
|
||||
#define MAKI_CMD_REMREF 4
|
||||
#define MAKI_CMD_RESETDLF 5
|
||||
|
||||
#define SCRIPT_FUNCTION_INIT static int __dlfid=-1, __linkcount=0; if (__cmd != NULL) return WASABI_API_MAKI->maki_updateDlf(__cmd, &__dlfid, &__linkcount);
|
||||
#define SCRIPT_FUNCTION_CHECKABORTEVENT if (__dlfid==-1) RETURN_SCRIPT_VOID;
|
||||
#define SCRIPT_FUNCTION_CHECKABORTEVENT_SYS(o) { SCRIPT_FUNCTION_CHECKABORTEVENT { SystemObject *so = static_cast<SystemObject *>(o->vcpu_getInterface(systemObjectGuid)); if (!so || !so->isLoaded()) RETURN_SCRIPT_VOID; } }
|
||||
#define PROCESS_HOOKS0(object, controller) { controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, NULL, 0); }
|
||||
#define PROCESS_HOOKS1(object, controller, p1) { scriptVar *__table[1] = {&p1}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 1); }
|
||||
#define PROCESS_HOOKS2(object, controller, p1, p2) { scriptVar *__table[2] = {&p1, &p2}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 2); }
|
||||
#define PROCESS_HOOKS3(object, controller, p1, p2, p3) { scriptVar *__table[3] = {&p1, &p2, &p3}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 3); }
|
||||
#define PROCESS_HOOKS4(object, controller, p1, p2, p3, p4) { scriptVar *__table[4] = {&p1, &p2, &p3, &p4}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 4); }
|
||||
#define PROCESS_HOOKS5(object, controller, p1, p2, p3, p4, p5) { scriptVar *__table[5] = {&p1, &p2, &p3, &p4, &p5}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 5); }
|
||||
#define PROCESS_HOOKS6(object, controller, p1, p2, p3, p4, p5, p6) { scriptVar *__table[6] = {&p1, &p2, &p3, &p4, &p5, &p6}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 6); }
|
||||
#define PROCESS_HOOKS7(object, controller, p1, p2, p3, p4, p5, p6, p7) { scriptVar *__table[7] = {&p1, &p2, &p3, &p4, &p5, &p6, &p7}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 7); }
|
||||
#define PROCESS_HOOKS8(object, controller, p1, p2, p3, p4, p5, p6, p7, p8) { scriptVar *__table[8] = {&p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 8); }
|
||||
#define PROCESS_HOOKS9(object, controller, p1, p2, p3, p4, p5, p6, p7, p8, p9) { scriptVar *__table[9] = {&p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &p9}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 9); }
|
||||
#define PROCESS_HOOKS10(object, controller, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) { scriptVar *__table[10] = {&p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &p9, &p10}; controller->processHooks(static_cast<ScriptObject *>(object), DLF_ID, __table, 10); }
|
||||
#define SCRIPT_EXEC_EVENT0(object) { return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 0); }
|
||||
#define SCRIPT_EXEC_EVENT1(object, p1) { WASABI_API_MAKI->maki_pushAny(p1); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 1); }
|
||||
#define SCRIPT_EXEC_EVENT2(object, p1, p2) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 2); }
|
||||
#define SCRIPT_EXEC_EVENT3(object, p1, p2, p3) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 3); }
|
||||
#define SCRIPT_EXEC_EVENT4(object, p1, p2, p3, p4) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 4); }
|
||||
#define SCRIPT_EXEC_EVENT5(object, p1, p2, p3, p4, p5) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); WASABI_API_MAKI->maki_pushAny(p5); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 5); }
|
||||
#define SCRIPT_EXEC_EVENT6(object, p1, p2, p3, p4, p5, p6) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); WASABI_API_MAKI->maki_pushAny(p5); WASABI_API_MAKI->maki_pushAny(p6); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 6); }
|
||||
#define SCRIPT_EXEC_EVENT7(object, p1, p2, p3, p4, p5, p6, p7) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); WASABI_API_MAKI->maki_pushAny(p5); WASABI_API_MAKI->maki_pushAny(p6); WASABI_API_MAKI->maki_pushAny(p7); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 7); }
|
||||
#define SCRIPT_EXEC_EVENT8(object, p1, p2, p3, p4, p5, p6, p7, p8) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); WASABI_API_MAKI->maki_pushAny(p5); WASABI_API_MAKI->maki_pushAny(p6); WASABI_API_MAKI->maki_pushAny(p7); WASABI_API_MAKI->maki_pushAny(p8); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 8); }
|
||||
#define SCRIPT_EXEC_EVENT9(object, p1, p2, p3, p4, p5, p6, p7, p8, p9) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); WASABI_API_MAKI->maki_pushAny(p5); WASABI_API_MAKI->maki_pushAny(p6); WASABI_API_MAKI->maki_pushAny(p7); WASABI_API_MAKI->maki_pushAny(p8); WASABI_API_MAKI->maki_pushAny(p9); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 9); }
|
||||
#define SCRIPT_EXEC_EVENT10(object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) { WASABI_API_MAKI->maki_pushAny(p1); WASABI_API_MAKI->maki_pushAny(p2); WASABI_API_MAKI->maki_pushAny(p3); WASABI_API_MAKI->maki_pushAny(p4); WASABI_API_MAKI->maki_pushAny(p5); WASABI_API_MAKI->maki_pushAny(p6); WASABI_API_MAKI->maki_pushAny(p7); WASABI_API_MAKI->maki_pushAny(p8); WASABI_API_MAKI->maki_pushAny(p9); WASABI_API_MAKI->maki_pushAny(p10); return WASABI_API_MAKI->maki_triggerEvent(object, DLF_ID, 10); }
|
||||
|
||||
#define SCRIPT_FUNCTION_PARAMS maki_cmd *__cmd, int __vsd
|
||||
#define SCRIPT_CALL NULL, -1
|
||||
#define GET_SCRIPT_INT(v) WASABI_API_MAKI->maki_getScriptInt(v)
|
||||
//CUT#define GET_SCRIPT_INT(v) ((v).getAsInt())
|
||||
#define GET_SCRIPT_BOOLEAN(v) WASABI_API_MAKI->maki_getScriptBoolean(v)
|
||||
#define GET_SCRIPT_FLOAT(v) WASABI_API_MAKI->maki_getScriptFloat(v)
|
||||
#define GET_SCRIPT_DOUBLE(v) WASABI_API_MAKI->maki_getScriptDouble(v)
|
||||
#define GET_SCRIPT_STRING(v) WASABI_API_MAKI->maki_getScriptString(v)
|
||||
#define GET_SCRIPT_OBJECT(v) WASABI_API_MAKI->maki_getScriptObject(v)
|
||||
|
||||
scriptVar COMEXP MAKE_SCRIPT_INT(int i);
|
||||
scriptVar COMEXP MAKE_SCRIPT_VOID();
|
||||
scriptVar COMEXP MAKE_SCRIPT_FLOAT(float f);
|
||||
scriptVar COMEXP MAKE_SCRIPT_DOUBLE(double d);
|
||||
scriptVar COMEXP MAKE_SCRIPT_BOOLEAN(int b);
|
||||
scriptVar COMEXP MAKE_SCRIPT_OBJECT(ScriptObject *o);
|
||||
scriptVar COMEXP MAKE_SCRIPT_STRING(const wchar_t *s);
|
||||
void COMEXP *GET_SCRIPT_OBJECT_AS(scriptVar v, GUID g);
|
||||
|
||||
#define FIXUP_FUNCTION_DLF SCRIPT_FUNCTION_INIT
|
||||
/*#define FIXUP_FUNCTION_DLF \
|
||||
static int fn_DLF=-1; \
|
||||
if (fn_DLF == -1 && DLFid == -1) { RETURN_SCRIPT_ZERO } \
|
||||
if (fn_DLF == -1 && DLFid != -1 && o == NULL) { \
|
||||
fn_DLF = DLFid; \
|
||||
RETURN_SCRIPT_VOID \
|
||||
} else if (DLFid != -1) { \
|
||||
ASSERTPR(0, "DLFId already set"); \
|
||||
RETURN_SCRIPT_VOID \
|
||||
}*/
|
||||
|
||||
#define DLF_ID __dlfid
|
||||
|
||||
#define RETURN_SCRIPT_EVENT \
|
||||
{ scriptVar script_event_return={SCRIPT_EVENT,0}; \
|
||||
return script_event_return; }
|
||||
|
||||
#define RETURN_SCRIPT_VOID \
|
||||
{ scriptVar script_event_return={SCRIPT_VOID,0}; \
|
||||
return script_event_return; }
|
||||
|
||||
#define RETURN_SCRIPT_ZERO \
|
||||
{ scriptVar script_event_return={SCRIPT_INT,0}; \
|
||||
return script_event_return; }
|
||||
|
||||
#define RETURN_SCRIPT_NULL \
|
||||
{ scriptVar script_event_return={SCRIPT_OBJECT,NULL}; \
|
||||
return script_event_return; }
|
||||
|
||||
#define SCRIPT_FUNCTION_INT(_class, func, call) \
|
||||
scriptVar _class::func(int DLFid, ScriptObject *o) { \
|
||||
FIXUP_FUNCTION_DLF \
|
||||
ASSERT(o != NULL); \
|
||||
scriptVar s = SOM::makeVar(SCRIPT_INT); \
|
||||
SOM::assign(&s, ((_class *)o)->call()); \
|
||||
return s;\
|
||||
}
|
||||
|
||||
#define DEC_SCRIPT_FUNCTION_INT(func1, func2) \
|
||||
static scriptVar func1(int DLFid, ScriptObject *o); \
|
||||
virtual int func2();
|
||||
|
||||
|
||||
#define EVENT_ID __dlfid
|
||||
|
||||
typedef struct {
|
||||
const wchar_t *function_name;
|
||||
int nparams;
|
||||
void *physical_ptr;
|
||||
} function_descriptor_struct;
|
||||
|
||||
typedef struct {
|
||||
ScriptHook *hook;
|
||||
ScriptObject *object;
|
||||
} object_hook_struct;
|
||||
|
||||
static const GUID ROOT_GUID =
|
||||
{ 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } };
|
||||
|
||||
|
||||
class ScriptObjectController : public Dispatchable {
|
||||
protected:
|
||||
ScriptObjectController() {};
|
||||
|
||||
public:
|
||||
|
||||
void onRegisterClass(ScriptObjectController *rootController);
|
||||
GUID getClassGuid();
|
||||
const wchar_t *getClassName();
|
||||
const wchar_t *getAncestorClassName();
|
||||
ScriptObjectController *getAncestorController();
|
||||
int getNumFunctions();
|
||||
const function_descriptor_struct *getExportedFunctions();
|
||||
ScriptObject *instantiate();
|
||||
void destroy(ScriptObject *o);
|
||||
void *encapsulate(ScriptObject *o);
|
||||
void deencapsulate(void *o);
|
||||
ScriptObject *cast(ScriptObject *o, GUID g);
|
||||
void setClassId(int id);
|
||||
int getClassId();
|
||||
void setAncestorClassId(int id);
|
||||
int getAncestorClassId();
|
||||
int getInstantiable();
|
||||
int getReferenceable();
|
||||
int processHooks(ScriptObject *o, int dlfid, scriptVar **table, int nparams);
|
||||
void addClassHook(ScriptHook *h);
|
||||
void addObjectHook(ScriptHook *h, ScriptObject *o);
|
||||
void removeHooks(ScriptHook *h);
|
||||
|
||||
enum {
|
||||
GETCLASSGUID = 100,
|
||||
GETCLASSNAME = 200,
|
||||
GETANCESTORCLASSNAME = 300,
|
||||
GETNUMFUNCTIONS = 400,
|
||||
GETEXPORTEDFUNCTIONS = 500,
|
||||
INSTANTIATE = 600,
|
||||
DESTROY = 700,
|
||||
GETCLASSID = 800,
|
||||
SETCLASSID = 900,
|
||||
SETANCESTORCLASSID = 1000,
|
||||
GETANCESTORCLASSID = 1100,
|
||||
GETINSTANTIABLE = 1200,
|
||||
GETREFERENCEABLE = 1300,
|
||||
PROCESSHOOKS = 1400,
|
||||
GETANCESTORCONTROLLER = 1500,
|
||||
ADDCLASSHOOK = 1600,
|
||||
ADDOBJHOOK = 1700,
|
||||
REMHOOKS = 1800,
|
||||
ONREGISTERCLASS = 1900,
|
||||
ENCAPSULATE = 2000,
|
||||
DEENCAPSULATE = 2100,
|
||||
CAST = 2200,
|
||||
};
|
||||
};
|
||||
|
||||
inline GUID ScriptObjectController::getClassGuid() {
|
||||
return _call(GETCLASSGUID, ROOT_GUID);
|
||||
}
|
||||
|
||||
inline const wchar_t *ScriptObjectController::getClassName()
|
||||
{
|
||||
return _call(GETCLASSNAME, (const wchar_t *)NULL);
|
||||
}
|
||||
|
||||
inline const wchar_t *ScriptObjectController::getAncestorClassName() {
|
||||
return _call(GETANCESTORCLASSNAME, (const wchar_t *)NULL);
|
||||
}
|
||||
|
||||
inline int ScriptObjectController::getNumFunctions() {
|
||||
return _call(GETNUMFUNCTIONS, 0);
|
||||
}
|
||||
|
||||
inline const function_descriptor_struct *ScriptObjectController::getExportedFunctions() {
|
||||
return _call(GETEXPORTEDFUNCTIONS, (const function_descriptor_struct *)NULL);
|
||||
}
|
||||
|
||||
inline ScriptObject *ScriptObjectController::instantiate() {
|
||||
return _call(INSTANTIATE, (ScriptObject *)NULL);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::destroy(ScriptObject *o) {
|
||||
_voidcall(DESTROY, o);
|
||||
}
|
||||
|
||||
inline int ScriptObjectController::getClassId() {
|
||||
return _call(GETCLASSID, 0);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::setClassId(int id) {
|
||||
_voidcall(SETCLASSID, id);
|
||||
}
|
||||
|
||||
inline int ScriptObjectController::getAncestorClassId() {
|
||||
return _call(GETANCESTORCLASSID, 0);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::setAncestorClassId(int id) {
|
||||
_voidcall(SETANCESTORCLASSID, id);
|
||||
}
|
||||
|
||||
inline int ScriptObjectController::getInstantiable() {
|
||||
return _call(GETINSTANTIABLE, 0);
|
||||
}
|
||||
|
||||
inline int ScriptObjectController::getReferenceable() {
|
||||
return _call(GETREFERENCEABLE, 0);
|
||||
}
|
||||
|
||||
inline ScriptObjectController *ScriptObjectController::getAncestorController() {
|
||||
return _call(GETANCESTORCONTROLLER, (ScriptObjectController *)NULL);
|
||||
}
|
||||
|
||||
inline int ScriptObjectController::processHooks(ScriptObject *o, int dlfid, scriptVar **table, int nparams) {
|
||||
return _call(PROCESSHOOKS, 0, o, dlfid, table, nparams);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::addClassHook(ScriptHook *h) {
|
||||
_voidcall(ADDCLASSHOOK, h);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::addObjectHook(ScriptHook *h, ScriptObject *o) {
|
||||
_voidcall(ADDOBJHOOK, h, o);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::removeHooks(ScriptHook *h) {
|
||||
_voidcall(REMHOOKS, h);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::onRegisterClass(ScriptObjectController *rootController) {
|
||||
_voidcall(ONREGISTERCLASS, rootController);
|
||||
}
|
||||
|
||||
inline void *ScriptObjectController::encapsulate(ScriptObject *o) {
|
||||
return _call(ENCAPSULATE, (void *) NULL, o);
|
||||
}
|
||||
|
||||
inline void ScriptObjectController::deencapsulate(void *o) {
|
||||
_voidcall(DEENCAPSULATE, o);
|
||||
}
|
||||
|
||||
inline ScriptObject *ScriptObjectController::cast(ScriptObject *o, GUID g) {
|
||||
return _call(CAST, (ScriptObject *)NULL, o, g);
|
||||
}
|
||||
|
||||
class ScriptObjectControllerI : public ScriptObjectController {
|
||||
public:
|
||||
|
||||
ScriptObjectControllerI();
|
||||
virtual ~ScriptObjectControllerI();
|
||||
|
||||
virtual void onRegisterClass(ScriptObjectController *rootController);
|
||||
virtual GUID getClassGuid()=0;
|
||||
virtual const wchar_t *getClassName()=0;
|
||||
virtual const wchar_t *getAncestorClassName()=0;
|
||||
virtual ScriptObjectController *getAncestorController()=0;
|
||||
virtual int getNumFunctions()=0;
|
||||
virtual const function_descriptor_struct *getExportedFunctions()=0;
|
||||
virtual ScriptObject *instantiate()=0;
|
||||
virtual void destroy(ScriptObject *o)=0;
|
||||
virtual void *encapsulate(ScriptObject *o)=0;
|
||||
virtual void deencapsulate(void *o)=0;
|
||||
virtual ScriptObject *cast(ScriptObject *o, GUID g);
|
||||
|
||||
virtual void setClassId(int id) { my_class_id = id; }
|
||||
virtual int getClassId() { return my_class_id; }
|
||||
virtual void setAncestorClassId(int id) { my_ancestor_class_id = id; }
|
||||
virtual int getAncestorClassId() { return my_ancestor_class_id; }
|
||||
virtual int getInstantiable() { return 1; };
|
||||
virtual int getReferenceable() { return 1; };
|
||||
virtual int processHooks(ScriptObject *o, int dlfid, scriptVar **table, int nparams);
|
||||
virtual void addClassHook(ScriptHook *h);
|
||||
virtual void addObjectHook(ScriptHook *h, ScriptObject *o);
|
||||
virtual void removeHooks(ScriptHook *h);
|
||||
|
||||
private:
|
||||
int my_class_id;
|
||||
int my_ancestor_class_id;
|
||||
|
||||
PtrList<object_hook_struct> objhooks;
|
||||
PtrList<ScriptHook> classhooks;
|
||||
ScriptObjectController *rootController;
|
||||
int incast;
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
#endif
|
1
Src/Wasabi/api/script/objcontrollert.cpp
Normal file
1
Src/Wasabi/api/script/objcontrollert.cpp
Normal file
|
@ -0,0 +1 @@
|
|||
#include "precomp.h"
|
67
Src/Wasabi/api/script/objcontrollert.h
Normal file
67
Src/Wasabi/api/script/objcontrollert.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
#ifndef __SCRIPTOBJECTCONTROLLERT_H
|
||||
#define __SCRIPTOBJECTCONTROLLERT_H
|
||||
|
||||
#include "objcontroller.h"
|
||||
|
||||
template <class T, class A>
|
||||
class ScriptObjectControllerT : public ScriptObjectControllerI {
|
||||
public:
|
||||
virtual const wchar_t *getClassName() { return T::scriptobject_getClassName(); }
|
||||
virtual const wchar_t *getAncestorClassName() { return A::scriptobject_getClassName(); }
|
||||
virtual ScriptObjectController *getAncestorController() {
|
||||
return WASABI_API_MAKI->maki_getController(A::scriptobject_getClassGuid());
|
||||
}
|
||||
virtual GUID getClassGuid() { return T::scriptobject_getClassGuid(); }
|
||||
virtual ScriptObject *instantiate() {
|
||||
return (new T)->getScriptObject();
|
||||
}
|
||||
virtual void destroy(ScriptObject *o) {
|
||||
T *t = static_cast<T *>(o->vcpu_getInterface(T::scriptobject_getClassGuid()));
|
||||
delete t;
|
||||
}
|
||||
virtual void *encapsulate(ScriptObject *o) { return NULL; }
|
||||
virtual void deencapsulate(void *o) { }
|
||||
|
||||
#if 0
|
||||
virtual int getNumFunctions() { return fn_descs.getNumItems(); }
|
||||
virtual const function_descriptor_struct *getExportedFunctions() {
|
||||
return fn_descs.enumRef(0);
|
||||
}
|
||||
protected:
|
||||
void addFn(const wchar_t *fnname, scriptcb *cb) {
|
||||
function_descriptor_struct fds;
|
||||
fds.function_name = fnname;
|
||||
fds.nparams = cb->getNumParams();
|
||||
fds.physical_ptr = cb->
|
||||
}
|
||||
private:
|
||||
TList fn_descs;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if 0
|
||||
class scriptcb {
|
||||
public:
|
||||
virtual void *getNumParams()=0;
|
||||
virtual void *getfn()=0;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class scriptcb0v : public scriptcb {
|
||||
typedef void (T::*fnPtrType)();
|
||||
public:
|
||||
scriptcb0v(fnPtrType _fn) : fn(_fn) { }
|
||||
static scriptVar call(SCRIPT_FUNCTION_PARAMS, ScriptObject *o) {
|
||||
SCRIPT_FUNCTION_INIT
|
||||
T *t = static_cast<T *>(o->vcpu_getInterface(T::scriptobject_getClassGuid()));
|
||||
if (t) (t->*fn)();
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
virtual void *getNumParams() { return 0; }
|
||||
virtual void *getfn() {
|
||||
return static_cast<void *>(call);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
438
Src/Wasabi/api/script/objects/PlaylistScriptObject.cpp
Normal file
438
Src/Wasabi/api/script/objects/PlaylistScriptObject.cpp
Normal file
|
@ -0,0 +1,438 @@
|
|||
// -----------------------------------------------------------------------------------------------------
|
||||
// Playlist Script Object
|
||||
//
|
||||
// functions for <pledit.mi>
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
#include <precomp.h>
|
||||
#include "main.h"
|
||||
|
||||
#include "PlaylistScriptObject.h"
|
||||
|
||||
#include <bfc/wasabi_std.h>
|
||||
#include <api/script/script.h>
|
||||
#include <api/script/scriptmgr.h>
|
||||
#include <api/script/scriptobj.h>
|
||||
#include <api/script/scriptguid.h>
|
||||
|
||||
#ifdef WASABI_COMPILE_MEDIACORE
|
||||
#include <api/service/svcs/svc_player.h>
|
||||
#include <api/core/buttons.h>
|
||||
#include <api/core/api_core.h>
|
||||
#include <api/core/corehandle.h> // safe to include even if core isn't there
|
||||
#endif
|
||||
|
||||
static PlaylistScriptController _playlistController;
|
||||
ScriptObjectController *playlistController = &_playlistController;
|
||||
|
||||
|
||||
#ifndef _WASABIRUNTIME
|
||||
|
||||
BEGIN_SERVICES(PlaylistObject_Svc);
|
||||
DECLARE_SERVICE(ScriptObjectCreator<PlaylistScriptObjectSvc>);
|
||||
END_SERVICES(PlaylistObject_Svc, _PlaylistObject_Svc);
|
||||
|
||||
#ifdef _X86_
|
||||
extern "C" { int _link_PlaylistObjectSvc; }
|
||||
#else
|
||||
extern "C" { int __link_PlaylistObjectSvc; }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// Functions Table
|
||||
function_descriptor_struct PlaylistScriptController::exportedFunction[] =
|
||||
{
|
||||
{L"showCurrentlyPlayingTrack", 0, (void*)SPlaylist::script_vcpu_showCurrentlyPlayingEntry},
|
||||
{L"showTrack", 1, (void*)SPlaylist::script_vcpu_showEntry},
|
||||
{L"getNumTracks", 0, (void*)SPlaylist::script_vcpu_getNumItems},
|
||||
{L"getCurrentIndex", 0, (void*)SPlaylist::script_vcpu_getCurrentIndex},
|
||||
{L"getRating", 1, (void*)SPlaylist::script_vcpu_getTrackRating},
|
||||
{L"setRating", 2, (void*)SPlaylist::script_vcpu_setTrackRating},
|
||||
{L"enqueueFile", 1, (void*)SPlaylist::script_vcpu_enqueueFile },
|
||||
{L"clear", 0, (void*)SPlaylist::script_vcpu_clear },
|
||||
{L"removeTrack", 1, (void*)SPlaylist::script_vcpu_removeTrack },
|
||||
{L"swapTracks", 2, (void*)SPlaylist::script_vcpu_swapTrack },
|
||||
{L"moveUp", 1, (void*)SPlaylist::script_vcpu_moveUp },
|
||||
{L"moveDown", 1, (void*)SPlaylist::script_vcpu_moveDown },
|
||||
{L"moveTo", 2, (void*)SPlaylist::script_vcpu_moveTo },
|
||||
{L"getTitle", 1, (void*)SPlaylist::script_vcpu_getTitle },
|
||||
{L"getLength", 1, (void*)SPlaylist::script_vcpu_getLength },
|
||||
{L"getMetaData", 2, (void*)SPlaylist::script_vcpu_getExtendedInfo },
|
||||
{L"getNumSelectedTracks", 0, (void*)SPlaylist::script_vcpu_getNumSelectedItems },
|
||||
{L"getNextSelectedTrack", 1, (void*)SPlaylist::script_vcpu_getNextSelectedItem },
|
||||
{L"getFileName", 1, (void*)SPlaylist::script_vcpu_getFileName },
|
||||
{L"playTrack", 1, (void*)SPlaylist::script_vcpu_playTrack },
|
||||
{L"onPleditModified", 0, (void*)SPlaylist::script_vcpu_onPleditModified },
|
||||
};
|
||||
|
||||
ScriptObjectController *PlaylistScriptObjectSvc::getController(int n)
|
||||
{
|
||||
switch (n) {
|
||||
case 0:
|
||||
return playlistController;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ScriptObject *PlaylistScriptController::instantiate()
|
||||
{
|
||||
SPlaylist *c = new SPlaylist;
|
||||
if (!c) return NULL;
|
||||
return c->getScriptObject();
|
||||
}
|
||||
|
||||
void PlaylistScriptController::destroy(ScriptObject *o)
|
||||
{
|
||||
SPlaylist *obj = static_cast<SPlaylist *>(o->vcpu_getInterface(playlistScriptObjectGUID));
|
||||
ASSERT(obj != NULL);
|
||||
delete obj;
|
||||
}
|
||||
|
||||
void *PlaylistScriptController::encapsulate(ScriptObject *o)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void PlaylistScriptController::deencapsulate(void *o)
|
||||
{
|
||||
}
|
||||
|
||||
int PlaylistScriptController::getNumFunctions()
|
||||
{
|
||||
return sizeof(exportedFunction) / sizeof(function_descriptor_struct);
|
||||
}
|
||||
|
||||
SPlaylist::SPlaylist()
|
||||
{
|
||||
getScriptObject()->vcpu_setInterface(playlistScriptObjectGUID, (void *)static_cast<SPlaylist *>(this));
|
||||
getScriptObject()->vcpu_setClassName(L"PlEdit");
|
||||
getScriptObject()->vcpu_setController(playlistController);
|
||||
|
||||
SOList.addItem(this);
|
||||
}
|
||||
|
||||
SPlaylist::~SPlaylist()
|
||||
{
|
||||
SOList.removeItem(this);
|
||||
}
|
||||
|
||||
// Script helper functions
|
||||
|
||||
void SPlaylist::onPleditModified ()
|
||||
{
|
||||
//This one is not working
|
||||
for (int i=0; i < SOList.getNumItems(); i++)
|
||||
{
|
||||
//script_vcpu_onPleditModified(SCRIPT_CALL, getScriptObject());
|
||||
script_vcpu_onPleditModified(SCRIPT_CALL, SOList.enumItem(i)->getScriptObject());
|
||||
//Std::messageBox(SOList.enumItem(i)->getClassName(), t, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void SPlaylist::showEntry( int i)
|
||||
{
|
||||
HWND hPeWindow = wa2.getWnd(IPC_GETWND_PE);
|
||||
SendMessageW(hPeWindow, WM_USER, 666, i);
|
||||
}
|
||||
|
||||
void SPlaylist::swap(int track1, int track2)
|
||||
{
|
||||
HWND hPeWindow = wa2.getWnd(IPC_GETWND_PE);
|
||||
|
||||
int i = wa2.PE_getCurrentIndex();
|
||||
|
||||
int param = ((track1) << 16) | (track2);
|
||||
SendMessageW(hPeWindow, WM_USER, IPC_PE_SWAPINDEX, param);
|
||||
|
||||
//Swap our currently playing item as well
|
||||
if (i == track1)
|
||||
{
|
||||
wa2.PE_setCurrentIndex(track2);
|
||||
}
|
||||
else if (i == track2)
|
||||
{
|
||||
wa2.PE_setCurrentIndex(track1);
|
||||
}
|
||||
}
|
||||
|
||||
fileinfoW *SPlaylist::getFileInfoStructW1 (int item)
|
||||
{
|
||||
static fileinfoW fi;
|
||||
fi.index = item;
|
||||
*(fi.file) = 0;
|
||||
HWND hPeWindow = wa2.getWnd(IPC_GETWND_PE);
|
||||
SendMessageW(hPeWindow, WM_USER, IPC_PE_GETINDEXINFOW_INPROC, (LPARAM)&fi);
|
||||
return &fi;
|
||||
}
|
||||
|
||||
// Script Calls
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_showCurrentlyPlayingEntry(SCRIPT_FUNCTION_PARAMS, ScriptObject *o)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT
|
||||
|
||||
showEntry (wa2.PE_getCurrentIndex());
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_showEntry(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT
|
||||
|
||||
showEntry (GET_SCRIPT_INT(i));
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getNumItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT
|
||||
|
||||
int i = wa2.PE_getNumItems();
|
||||
|
||||
return MAKE_SCRIPT_INT(i);
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getCurrentIndex(SCRIPT_FUNCTION_PARAMS, ScriptObject *o)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT
|
||||
|
||||
int i = wa2.PE_getCurrentIndex();
|
||||
|
||||
return MAKE_SCRIPT_INT(i);
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_setTrackRating(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i, scriptVar rating)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT
|
||||
|
||||
HWND hwnd_winamp = wa2.getMainWindow();
|
||||
|
||||
int cur_pos = wa2.PE_getCurrentIndex();
|
||||
wa2.PE_setCurrentIndex(GET_SCRIPT_INT(i));
|
||||
SendMessageW(hwnd_winamp, WM_WA_IPC, GET_SCRIPT_INT(rating), IPC_SETRATING);
|
||||
wa2.PE_setCurrentIndex(cur_pos);
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getTrackRating(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT
|
||||
|
||||
HWND hwnd_winamp = wa2.getMainWindow();
|
||||
|
||||
int cur_pos = wa2.PE_getCurrentIndex();
|
||||
wa2.PE_setCurrentIndex(GET_SCRIPT_INT(i));
|
||||
int r = 0;
|
||||
r = SendMessageW(hwnd_winamp, WM_WA_IPC, GET_SCRIPT_INT(i), IPC_GETRATING);
|
||||
wa2.PE_setCurrentIndex(cur_pos);
|
||||
|
||||
return MAKE_SCRIPT_INT(r);
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_enqueueFile(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar file)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
wa2.enqueueFile (GET_SCRIPT_STRING(file));
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_clear(SCRIPT_FUNCTION_PARAMS, ScriptObject *o)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
wa2.clearPlaylist();
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_removeTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
HWND hPeWindow = wa2.getWnd(IPC_GETWND_PE);
|
||||
SendMessageW(hPeWindow, WM_USER, IPC_PE_DELETEINDEX, GET_SCRIPT_INT(i));
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_swapTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track1, scriptVar _track2)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track1 = GET_SCRIPT_INT(_track1);
|
||||
int track2 = GET_SCRIPT_INT(_track2);
|
||||
|
||||
if (track1 >= wa2.PE_getNumItems() || track1 < 0 || track2 >= wa2.PE_getNumItems() || track2 < 0) RETURN_SCRIPT_VOID;
|
||||
swap ((track1), (track2));
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_moveUp(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
if (track < wa2.PE_getNumItems()-1) swap (track, track+1);
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_moveDown(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
if (track > 0) swap (track, track-1);
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_moveTo(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track, scriptVar _pos)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
int pos = GET_SCRIPT_INT(_pos);
|
||||
|
||||
if (track == pos || pos >= wa2.PE_getNumItems() || pos < 0 || track >= wa2.PE_getNumItems() || track < 0)
|
||||
{
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
// Martin> This can be done much faster :P
|
||||
/*if (track > pos)
|
||||
{
|
||||
for (int i = track; i > pos; i--)
|
||||
{
|
||||
swap (i, i-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = track; i < pos; i++)
|
||||
{
|
||||
swap (i, i+1);
|
||||
}
|
||||
}*/
|
||||
HWND hPeWindow = wa2.getWnd(IPC_GETWND_PE);
|
||||
fileinfoW *fi = getFileInfoStructW1(track);
|
||||
SendMessageW(hPeWindow, WM_USER, IPC_PE_DELETEINDEX, fi->index);
|
||||
fi->index = pos;
|
||||
static COPYDATASTRUCT cds;
|
||||
cds.dwData = IPC_PE_INSERTFILENAMEW;
|
||||
cds.lpData = fi;
|
||||
SendMessageW(hPeWindow, WM_COPYDATA, NULL, (LPARAM)&cds);
|
||||
|
||||
RETURN_SCRIPT_VOID;
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getTitle(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
|
||||
// Martin> There might be a better way to convert this;)
|
||||
// benski> yes, there is :) see below. There's a unicode equivalent API for this, just wasn't enabled in wa2frontend object
|
||||
// so I added it
|
||||
fileinfo2W *fi = wa2.PE_getFileTitleW(track);
|
||||
if (fi)
|
||||
return MAKE_SCRIPT_STRING(fi->filetitle);
|
||||
else
|
||||
return MAKE_SCRIPT_STRING(L"");
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getLength(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
|
||||
fileinfo2W *fi = wa2.PE_getFileTitleW(track);
|
||||
if (fi)
|
||||
return MAKE_SCRIPT_STRING((fi->filelength));
|
||||
else
|
||||
return MAKE_SCRIPT_STRING(L"");
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getFileName(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
|
||||
fileinfoW *fi = getFileInfoStructW1(track);
|
||||
|
||||
return MAKE_SCRIPT_STRING(fi->file);
|
||||
}
|
||||
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getExtendedInfo(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track, scriptVar _name)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
const wchar_t *name = GET_SCRIPT_STRING(_name);
|
||||
|
||||
fileinfoW *fi = getFileInfoStructW1(track);
|
||||
|
||||
wa2.getMetaData((fi->file), name, staticStr, 4096);
|
||||
|
||||
return MAKE_SCRIPT_STRING(staticStr);
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getNumSelectedItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
HWND hPeWindow = wa2.getWnd(IPC_GETWND_PE);
|
||||
int ret = SendMessageW(hPeWindow, WM_USER, IPC_PE_GETSELECTEDCOUNT, 0);
|
||||
|
||||
return MAKE_SCRIPT_INT(ret);
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_getNextSelectedItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
|
||||
track = SendMessageW(wa2.getMainWindow(), WM_USER, track, IPC_PLAYLIST_GET_NEXT_SELECTED);
|
||||
|
||||
return MAKE_SCRIPT_INT(track);
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_playTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
#ifdef WASABI_COMPILE_MEDIACORE
|
||||
int track = GET_SCRIPT_INT(_track);
|
||||
WASABI_API_MEDIACORE->core_userButton(0, UserButton::STOP);
|
||||
wa2.PE_setCurrentIndex(track);
|
||||
WASABI_API_MEDIACORE->core_userButton(0, UserButton::PLAY);
|
||||
return MAKE_SCRIPT_VOID();
|
||||
#else
|
||||
RETURN_SCRIPT_VOID;
|
||||
#endif
|
||||
}
|
||||
|
||||
scriptVar SPlaylist::script_vcpu_onPleditModified(SCRIPT_FUNCTION_PARAMS, ScriptObject *o)
|
||||
{
|
||||
SCRIPT_FUNCTION_INIT;
|
||||
PROCESS_HOOKS0(o, playlistController);
|
||||
SCRIPT_FUNCTION_CHECKABORTEVENT;
|
||||
SCRIPT_EXEC_EVENT0(o);
|
||||
}
|
||||
|
||||
wchar_t SPlaylist::staticStr[4096] = {0};
|
||||
PtrList < SPlaylist > SPlaylist::SOList;
|
102
Src/Wasabi/api/script/objects/PlaylistScriptObject.h
Normal file
102
Src/Wasabi/api/script/objects/PlaylistScriptObject.h
Normal file
|
@ -0,0 +1,102 @@
|
|||
#ifndef NULLSOFT_GEN_FF_PLAYLISTSCRIPTOBJECT_H
|
||||
#define NULLSOFT_GEN_FF_PLAYLISTSCRIPTOBJECT_H
|
||||
|
||||
#include "wa2frontend.h"
|
||||
|
||||
class SPlaylist;
|
||||
|
||||
#include <api/script/script.h>
|
||||
#include <api/script/objects/rootobj.h>
|
||||
#include <api/script/objects/rootobject.h>
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
#include <api/service/svcs/svc_scriptobji.h>
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// ScriptObject Provider Service
|
||||
|
||||
class PlaylistScriptObjectSvc : public svc_scriptObjectI {
|
||||
|
||||
public:
|
||||
PlaylistScriptObjectSvc() {};
|
||||
virtual ~PlaylistScriptObjectSvc() {};
|
||||
|
||||
static const char *getServiceName() { return "PlEdit maki object"; }
|
||||
virtual ScriptObjectController *getController(int n);
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// PlaylistScriptObject GUID
|
||||
// {345BEEBC-0229-4921-90BE-6CB6A49A79D9}
|
||||
static const GUID playlistScriptObjectGUID =
|
||||
{ 0x345beebc, 0x229, 0x4921, { 0x90, 0xbe, 0x6c, 0xb6, 0xa4, 0x9a, 0x79, 0xd9 } };
|
||||
|
||||
#define SPLAYLIST_SCRIPTPARENT RootObjectInstance
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// ScriptObject Service
|
||||
|
||||
class PlaylistScriptController : public ScriptObjectControllerI {
|
||||
public:
|
||||
|
||||
virtual const wchar_t *getClassName() { return L"PlEdit"; }
|
||||
virtual const wchar_t *getAncestorClassName() { return L"Object"; }
|
||||
virtual ScriptObjectController *getAncestorController() { return rootScriptObjectController; }
|
||||
virtual int getNumFunctions();
|
||||
virtual const function_descriptor_struct *getExportedFunctions() { return exportedFunction; }
|
||||
virtual GUID getClassGuid() { return playlistScriptObjectGUID; }
|
||||
//virtual int getInstantiable() { return 0; }
|
||||
//virtual int getReferenceable() { return 0; }
|
||||
virtual ScriptObject *instantiate();
|
||||
virtual void destroy(ScriptObject *o);
|
||||
virtual void *encapsulate(ScriptObject *o);
|
||||
virtual void deencapsulate(void *o);
|
||||
|
||||
private:
|
||||
|
||||
static function_descriptor_struct exportedFunction[];
|
||||
|
||||
};
|
||||
|
||||
extern ScriptObjectController *playlistController;
|
||||
|
||||
class SPlaylist : public SPLAYLIST_SCRIPTPARENT {
|
||||
public:
|
||||
SPlaylist();
|
||||
virtual ~SPlaylist();
|
||||
|
||||
static PtrList < SPlaylist > SOList;
|
||||
|
||||
static void onPleditModified();
|
||||
static void showEntry (int i);
|
||||
static void swap (int a, int b);
|
||||
static fileinfoW * getFileInfoStructW1 (int index);
|
||||
|
||||
// Maki functions table
|
||||
static scriptVar script_vcpu_showCurrentlyPlayingEntry(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
|
||||
static scriptVar script_vcpu_showEntry(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
|
||||
static scriptVar script_vcpu_getCurrentIndex(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
|
||||
static scriptVar script_vcpu_getNumItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
|
||||
static scriptVar script_vcpu_getTrackRating(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
|
||||
static scriptVar script_vcpu_setTrackRating(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i, scriptVar rating);
|
||||
static scriptVar script_vcpu_enqueueFile (SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar file);
|
||||
static scriptVar script_vcpu_clear(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
|
||||
static scriptVar script_vcpu_removeTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
|
||||
static scriptVar script_vcpu_swapTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track, scriptVar to);
|
||||
static scriptVar script_vcpu_moveUp(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track);
|
||||
static scriptVar script_vcpu_moveDown(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track);
|
||||
static scriptVar script_vcpu_moveTo(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar track, scriptVar to);
|
||||
static scriptVar script_vcpu_getTitle(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track);
|
||||
static scriptVar script_vcpu_getLength(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track);
|
||||
static scriptVar script_vcpu_getExtendedInfo(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _track, scriptVar _name);
|
||||
static scriptVar script_vcpu_getNumSelectedItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
|
||||
static scriptVar script_vcpu_getNextSelectedItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _num);
|
||||
static scriptVar script_vcpu_getFileName(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _num);
|
||||
static scriptVar script_vcpu_playTrack(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar _num);
|
||||
static scriptVar script_vcpu_onPleditModified(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
|
||||
|
||||
private:
|
||||
static wchar_t staticStr[4096];
|
||||
};
|
||||
|
||||
#endif
|
127
Src/Wasabi/api/script/objects/c_script/c_browser.cpp
Normal file
127
Src/Wasabi/api/script/objects/c_script/c_browser.cpp
Normal file
|
@ -0,0 +1,127 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_browser.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Browser::C_Browser(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Browser::C_Browser() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Browser::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, browserGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
navigateurl_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"navigateUrl", this);
|
||||
back_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"back", this);
|
||||
forward_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"forward", this);
|
||||
stop_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"stop", this);
|
||||
refresh_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"refresh", this);
|
||||
home_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"home", this);
|
||||
settargetname_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetName", this);
|
||||
onbeforenavigate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onBeforeNavigate", this);
|
||||
ondocumentcomplete_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDocumentComplete", this);
|
||||
onmedialink_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMediaLink", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Browser::~C_Browser() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Browser::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_BROWSER_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Browser::navigateUrl(const wchar_t *url)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(url);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), navigateurl_id, params);
|
||||
}
|
||||
|
||||
void C_Browser::back() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), back_id, NULL);
|
||||
}
|
||||
|
||||
void C_Browser::forward() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), forward_id, NULL);
|
||||
}
|
||||
|
||||
void C_Browser::stop() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), stop_id, NULL);
|
||||
}
|
||||
|
||||
void C_Browser::refresh() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), refresh_id, NULL);
|
||||
}
|
||||
|
||||
void C_Browser::home() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), home_id, NULL);
|
||||
}
|
||||
|
||||
void C_Browser::setTargetName(const wchar_t *targetname) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(targetname);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetname_id, params);
|
||||
}
|
||||
|
||||
int C_Browser::onBeforeNavigate(const wchar_t *url, int flags, const wchar_t *targetframename) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(url);
|
||||
scriptVar b = MAKE_SCRIPT_INT(flags);
|
||||
scriptVar c = MAKE_SCRIPT_STRING(targetframename);
|
||||
scriptVar *params[3] = {&a, &b, &c};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onbeforenavigate_id, params));
|
||||
}
|
||||
|
||||
void C_Browser::onDocumentComplete(const wchar_t *url) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(url);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondocumentcomplete_id, params);
|
||||
}
|
||||
|
||||
void C_Browser::onMediaLink(const wchar_t *url)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(url);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmedialink_id, params);
|
||||
}
|
||||
|
||||
int C_Browser::loaded=0;
|
||||
int C_Browser::navigateurl_id=0;
|
||||
int C_Browser::back_id=0;
|
||||
int C_Browser::forward_id=0;
|
||||
int C_Browser::stop_id=0;
|
||||
int C_Browser::refresh_id=0;
|
||||
int C_Browser::home_id=0;
|
||||
int C_Browser::settargetname_id=0;
|
||||
int C_Browser::onbeforenavigate_id=0;
|
||||
int C_Browser::ondocumentcomplete_id=0;
|
||||
int C_Browser::onmedialink_id=0;
|
||||
|
49
Src/Wasabi/api/script/objects/c_script/c_browser.h
Normal file
49
Src/Wasabi/api/script/objects/c_script/c_browser.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_BROWSER_H
|
||||
#define __C_BROWSER_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_BROWSER_PARENT C_GuiObject
|
||||
|
||||
class C_Browser : public C_BROWSER_PARENT {
|
||||
public:
|
||||
|
||||
C_Browser(ScriptObject *object);
|
||||
C_Browser();
|
||||
virtual ~C_Browser();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void navigateUrl(const wchar_t *url);
|
||||
virtual void back();
|
||||
virtual void forward();
|
||||
virtual void stop();
|
||||
virtual void refresh();
|
||||
virtual void home();
|
||||
virtual void setTargetName(const wchar_t *targetname);
|
||||
virtual int onBeforeNavigate(const wchar_t *url, int flags, const wchar_t *targetframename);
|
||||
virtual void onDocumentComplete(const wchar_t *url);
|
||||
virtual void onMediaLink(const wchar_t *url);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int navigateurl_id;
|
||||
static int back_id;
|
||||
static int forward_id;
|
||||
static int stop_id;
|
||||
static int refresh_id;
|
||||
static int home_id;
|
||||
static int settargetname_id;
|
||||
static int onbeforenavigate_id;
|
||||
static int ondocumentcomplete_id;
|
||||
static int onmedialink_id;
|
||||
};
|
||||
|
||||
#endif
|
104
Src/Wasabi/api/script/objects/c_script/c_button.cpp
Normal file
104
Src/Wasabi/api/script/objects/c_script/c_button.cpp
Normal file
|
@ -0,0 +1,104 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_button.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Button::C_Button(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Button::C_Button() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Button::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, buttonGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
onactivate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onActivate", this);
|
||||
onleftclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftClick", this);
|
||||
onrightclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightClick", this);
|
||||
setactivated_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setActivated", this);
|
||||
setactivatednocallback_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setActivatedNoCallback", this);
|
||||
getactivated_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getActivated", this);
|
||||
leftclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"leftClick", this);
|
||||
rightclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"rightClick", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Button::~C_Button() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Button::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_BUTTON_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Button::onActivate(int activated) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(activated);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onactivate_id, params);
|
||||
}
|
||||
|
||||
void C_Button::onLeftClick() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftclick_id, NULL);
|
||||
}
|
||||
|
||||
void C_Button::onRightClick() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightclick_id, NULL);
|
||||
}
|
||||
|
||||
void C_Button::setActivated(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setactivated_id, params);
|
||||
}
|
||||
|
||||
void C_Button::setActivatedNoCallback(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setactivatednocallback_id, params);
|
||||
}
|
||||
|
||||
int C_Button::getActivated() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getactivated_id, NULL));
|
||||
}
|
||||
|
||||
void C_Button::leftClick() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), leftclick_id, NULL);
|
||||
}
|
||||
|
||||
void C_Button::rightClick() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), rightclick_id, NULL);
|
||||
}
|
||||
|
||||
int C_Button::loaded=0;
|
||||
int C_Button::onactivate_id=0;
|
||||
int C_Button::onleftclick_id=0;
|
||||
int C_Button::onrightclick_id=0;
|
||||
int C_Button::setactivated_id=0;
|
||||
int C_Button::setactivatednocallback_id=0;
|
||||
int C_Button::getactivated_id=0;
|
||||
int C_Button::leftclick_id=0;
|
||||
int C_Button::rightclick_id=0;
|
45
Src/Wasabi/api/script/objects/c_script/c_button.h
Normal file
45
Src/Wasabi/api/script/objects/c_script/c_button.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_BUTTON_H
|
||||
#define __C_BUTTON_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_BUTTON_PARENT C_GuiObject
|
||||
|
||||
class C_Button : public C_BUTTON_PARENT {
|
||||
public:
|
||||
|
||||
C_Button(ScriptObject *object);
|
||||
C_Button();
|
||||
virtual ~C_Button();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onActivate(int activated);
|
||||
virtual void onLeftClick();
|
||||
virtual void onRightClick();
|
||||
virtual void setActivated(int onoff);
|
||||
virtual void setActivatedNoCallback(int onoff);
|
||||
virtual int getActivated();
|
||||
virtual void leftClick();
|
||||
virtual void rightClick();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onactivate_id;
|
||||
static int onleftclick_id;
|
||||
static int onrightclick_id;
|
||||
static int setactivated_id;
|
||||
static int setactivatednocallback_id;
|
||||
static int getactivated_id;
|
||||
static int leftclick_id;
|
||||
static int rightclick_id;
|
||||
};
|
||||
|
||||
#endif
|
84
Src/Wasabi/api/script/objects/c_script/c_checkbox.cpp
Normal file
84
Src/Wasabi/api/script/objects/c_script/c_checkbox.cpp
Normal file
|
@ -0,0 +1,84 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_checkbox.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_CheckBox::C_CheckBox(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_CheckBox::C_CheckBox() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_CheckBox::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, checkBoxGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
ontoggle_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onToggle", this);
|
||||
setchecked_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setChecked", this);
|
||||
ischecked_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isChecked", this);
|
||||
settext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setText", this);
|
||||
gettext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getText", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_CheckBox::~C_CheckBox() {
|
||||
}
|
||||
|
||||
ScriptObject *C_CheckBox::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_CHECKBOX_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_CheckBox::onToggle(int newstate) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(newstate);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontoggle_id, params);
|
||||
}
|
||||
|
||||
void C_CheckBox::setChecked(int checked) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(checked);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setchecked_id, params);
|
||||
}
|
||||
|
||||
int C_CheckBox::isChecked() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ischecked_id, NULL));
|
||||
}
|
||||
|
||||
void C_CheckBox::setText(const wchar_t *txt)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(txt);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settext_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_CheckBox::getText() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettext_id, NULL));
|
||||
}
|
||||
|
||||
int C_CheckBox::loaded=0;
|
||||
int C_CheckBox::ontoggle_id=0;
|
||||
int C_CheckBox::setchecked_id=0;
|
||||
int C_CheckBox::ischecked_id=0;
|
||||
int C_CheckBox::settext_id=0;
|
||||
int C_CheckBox::gettext_id=0;
|
39
Src/Wasabi/api/script/objects/c_script/c_checkbox.h
Normal file
39
Src/Wasabi/api/script/objects/c_script/c_checkbox.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_CHECKBOX_H
|
||||
#define __C_CHECKBOX_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_CHECKBOX_PARENT C_GuiObject
|
||||
|
||||
class C_CheckBox : public C_CHECKBOX_PARENT {
|
||||
public:
|
||||
|
||||
C_CheckBox(ScriptObject *object);
|
||||
C_CheckBox();
|
||||
virtual ~C_CheckBox();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onToggle(int newstate);
|
||||
virtual void setChecked(int checked);
|
||||
virtual int isChecked();
|
||||
virtual void setText(const wchar_t *txt);
|
||||
virtual const wchar_t *getText();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int ontoggle_id;
|
||||
static int setchecked_id;
|
||||
static int ischecked_id;
|
||||
static int settext_id;
|
||||
static int gettext_id;
|
||||
};
|
||||
|
||||
#endif
|
179
Src/Wasabi/api/script/objects/c_script/c_container.cpp
Normal file
179
Src/Wasabi/api/script/objects/c_script/c_container.cpp
Normal file
|
@ -0,0 +1,179 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_container.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Container::C_Container(ScriptObject *object) : C_RootObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Container::C_Container() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Container::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, containerGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
onswitchtolayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSwitchToLayout", this);
|
||||
onbeforeswitchtolayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onBeforeSwitchToLayout", this);
|
||||
setxmlparam_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setXmlParam", this);
|
||||
onhidelayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onHideLayout", this);
|
||||
onshowlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onShowLayout", this);
|
||||
getlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLayout", this);
|
||||
getnumlayouts_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumLayouts", this);
|
||||
enumlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumLayout", this);
|
||||
switchtolayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"switchToLayout", this);
|
||||
show_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"show", this);
|
||||
hide_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hide", this);
|
||||
close_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"close", this);
|
||||
toggle_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"toggle", this);
|
||||
isdynamic_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isDynamic", this);
|
||||
setname_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setName", this);
|
||||
getcurlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getCurLayout", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Container::~C_Container() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Container::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_CONTAINER_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Container::onSwitchToLayout(ScriptObject *newlayout) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(newlayout);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onswitchtolayout_id, params);
|
||||
}
|
||||
|
||||
void C_Container::onBeforeSwitchToLayout(ScriptObject *oldlayout, ScriptObject *newlayout) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(oldlayout);
|
||||
scriptVar b = MAKE_SCRIPT_OBJECT(newlayout);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onbeforeswitchtolayout_id, params);
|
||||
}
|
||||
|
||||
void C_Container::setXmlParam(const wchar_t *param, const wchar_t *value)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(param);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(value);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setxmlparam_id, params);
|
||||
}
|
||||
|
||||
void C_Container::onHideLayout(ScriptObject *_layout) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(_layout);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onhidelayout_id, params);
|
||||
}
|
||||
|
||||
void C_Container::onShowLayout(ScriptObject *_layout) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(_layout);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onshowlayout_id, params);
|
||||
}
|
||||
|
||||
ScriptObject *C_Container::getLayout(const wchar_t *layout_id)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(layout_id);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getlayout_id, params));
|
||||
}
|
||||
|
||||
int C_Container::getNumLayouts() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumlayouts_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_Container::enumLayout(int num) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(num);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumlayout_id, params));
|
||||
}
|
||||
|
||||
void C_Container::switchToLayout(const wchar_t *layout_id)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(layout_id);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), switchtolayout_id, params);
|
||||
}
|
||||
|
||||
void C_Container::show() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), show_id, NULL);
|
||||
}
|
||||
|
||||
void C_Container::hide() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), hide_id, NULL);
|
||||
}
|
||||
|
||||
void C_Container::close() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), close_id, NULL);
|
||||
}
|
||||
|
||||
void C_Container::toggle() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), toggle_id, NULL);
|
||||
}
|
||||
|
||||
int C_Container::isDynamic() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isdynamic_id, NULL));
|
||||
}
|
||||
|
||||
void C_Container::setName(const wchar_t *name)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(name);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setname_id, params);
|
||||
}
|
||||
|
||||
ScriptObject *C_Container::getCurLayout() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcurlayout_id, NULL));
|
||||
}
|
||||
|
||||
int C_Container::loaded=0;
|
||||
int C_Container::onswitchtolayout_id=0;
|
||||
int C_Container::onbeforeswitchtolayout_id=0;
|
||||
int C_Container::setxmlparam_id=0;
|
||||
int C_Container::onhidelayout_id=0;
|
||||
int C_Container::onshowlayout_id=0;
|
||||
int C_Container::getlayout_id=0;
|
||||
int C_Container::getnumlayouts_id=0;
|
||||
int C_Container::enumlayout_id=0;
|
||||
int C_Container::switchtolayout_id=0;
|
||||
int C_Container::show_id=0;
|
||||
int C_Container::hide_id=0;
|
||||
int C_Container::close_id=0;
|
||||
int C_Container::toggle_id=0;
|
||||
int C_Container::isdynamic_id=0;
|
||||
int C_Container::setname_id=0;
|
||||
int C_Container::getcurlayout_id=0;
|
61
Src/Wasabi/api/script/objects/c_script/c_container.h
Normal file
61
Src/Wasabi/api/script/objects/c_script/c_container.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_CONTAINER_H
|
||||
#define __C_CONTAINER_H
|
||||
|
||||
#include "c_rootobj.h"
|
||||
|
||||
#define C_CONTAINER_PARENT C_RootObject
|
||||
|
||||
class C_Container : public C_CONTAINER_PARENT {
|
||||
public:
|
||||
|
||||
C_Container(ScriptObject *object);
|
||||
C_Container();
|
||||
virtual ~C_Container();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onSwitchToLayout(ScriptObject *newlayout);
|
||||
virtual void onBeforeSwitchToLayout(ScriptObject *oldlayout, ScriptObject *newlayout);
|
||||
virtual void setXmlParam(const wchar_t *param, const wchar_t *value);
|
||||
virtual void onHideLayout(ScriptObject *_layout);
|
||||
virtual void onShowLayout(ScriptObject *_layout);
|
||||
virtual ScriptObject *getLayout(const wchar_t *layout_id);
|
||||
virtual int getNumLayouts();
|
||||
virtual ScriptObject *enumLayout(int num);
|
||||
virtual void switchToLayout(const wchar_t *layout_id);
|
||||
virtual void show();
|
||||
virtual void hide();
|
||||
virtual void close();
|
||||
virtual void toggle();
|
||||
virtual int isDynamic();
|
||||
virtual void setName(const wchar_t *name);
|
||||
virtual ScriptObject *getCurLayout();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onswitchtolayout_id;
|
||||
static int onbeforeswitchtolayout_id;
|
||||
static int setxmlparam_id;
|
||||
static int onhidelayout_id;
|
||||
static int onshowlayout_id;
|
||||
static int getlayout_id;
|
||||
static int getnumlayouts_id;
|
||||
static int enumlayout_id;
|
||||
static int switchtolayout_id;
|
||||
static int show_id;
|
||||
static int hide_id;
|
||||
static int close_id;
|
||||
static int toggle_id;
|
||||
static int isdynamic_id;
|
||||
static int setname_id;
|
||||
static int getcurlayout_id;
|
||||
};
|
||||
|
||||
#endif
|
184
Src/Wasabi/api/script/objects/c_script/c_dropdownlist.cpp
Normal file
184
Src/Wasabi/api/script/objects/c_script/c_dropdownlist.cpp
Normal file
|
@ -0,0 +1,184 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_dropdownlist.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_DropDownList::C_DropDownList(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_DropDownList::C_DropDownList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_DropDownList::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, dropDownListGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
getitemselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemSelected", this);
|
||||
onselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSelect", this);
|
||||
setlistheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setListHeight", this);
|
||||
openlist_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"openList", this);
|
||||
closelist_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"closeList", this);
|
||||
setitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setItems", this);
|
||||
additem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"addItem", this);
|
||||
delitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"delItem", this);
|
||||
finditem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"findItem", this);
|
||||
getnumitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumItems", this);
|
||||
selectitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectItem", this);
|
||||
getitemtext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemText", this);
|
||||
getselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSelected", this);
|
||||
getselectedtext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSelectedText", this);
|
||||
getcustomtext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getCustomText", this);
|
||||
deleteallitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"deleteAllItems", this);
|
||||
setnoitemtext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setNoItemText", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_DropDownList::~C_DropDownList() {
|
||||
}
|
||||
|
||||
ScriptObject *C_DropDownList::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_DROPDOWNLIST_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
const wchar_t *C_DropDownList::getItemSelected()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemselected_id, NULL));
|
||||
}
|
||||
|
||||
void C_DropDownList::onSelect(int id, int hover) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(id);
|
||||
scriptVar b = MAKE_SCRIPT_INT(hover);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onselect_id, params);
|
||||
}
|
||||
|
||||
void C_DropDownList::setListHeight(int h) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(h);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setlistheight_id, params);
|
||||
}
|
||||
|
||||
void C_DropDownList::openList() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), openlist_id, NULL);
|
||||
}
|
||||
|
||||
void C_DropDownList::closeList() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), closelist_id, NULL);
|
||||
}
|
||||
|
||||
void C_DropDownList::setItems(const wchar_t *lotsofitems)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(lotsofitems);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setitems_id, params);
|
||||
}
|
||||
|
||||
int C_DropDownList::addItem(const wchar_t *_text) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(_text);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), additem_id, params));
|
||||
}
|
||||
|
||||
void C_DropDownList::delItem(int id) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(id);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), delitem_id, params);
|
||||
}
|
||||
|
||||
int C_DropDownList::findItem(const wchar_t *_text) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(_text);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), finditem_id, params));
|
||||
}
|
||||
|
||||
int C_DropDownList::getNumItems() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumitems_id, NULL));
|
||||
}
|
||||
|
||||
void C_DropDownList::selectItem(int id, int hover) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(id);
|
||||
scriptVar b = MAKE_SCRIPT_INT(hover);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectitem_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_DropDownList::getItemText(int id) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(id);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemtext_id, params));
|
||||
}
|
||||
|
||||
int C_DropDownList::getSelected() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getselected_id, NULL));
|
||||
}
|
||||
|
||||
const wchar_t *C_DropDownList::getSelectedText() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getselectedtext_id, NULL));
|
||||
}
|
||||
|
||||
const wchar_t *C_DropDownList::getCustomText() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcustomtext_id, NULL));
|
||||
}
|
||||
|
||||
void C_DropDownList::deleteAllItems() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), deleteallitems_id, NULL);
|
||||
}
|
||||
|
||||
void C_DropDownList::setNoItemText(const wchar_t *txt) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(txt);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setnoitemtext_id, params);
|
||||
}
|
||||
|
||||
int C_DropDownList::loaded=0;
|
||||
int C_DropDownList::getitemselected_id=0;
|
||||
int C_DropDownList::onselect_id=0;
|
||||
int C_DropDownList::setlistheight_id=0;
|
||||
int C_DropDownList::openlist_id=0;
|
||||
int C_DropDownList::closelist_id=0;
|
||||
int C_DropDownList::setitems_id=0;
|
||||
int C_DropDownList::additem_id=0;
|
||||
int C_DropDownList::delitem_id=0;
|
||||
int C_DropDownList::finditem_id=0;
|
||||
int C_DropDownList::getnumitems_id=0;
|
||||
int C_DropDownList::selectitem_id=0;
|
||||
int C_DropDownList::getitemtext_id=0;
|
||||
int C_DropDownList::getselected_id=0;
|
||||
int C_DropDownList::getselectedtext_id=0;
|
||||
int C_DropDownList::getcustomtext_id=0;
|
||||
int C_DropDownList::deleteallitems_id=0;
|
||||
int C_DropDownList::setnoitemtext_id=0;
|
63
Src/Wasabi/api/script/objects/c_script/c_dropdownlist.h
Normal file
63
Src/Wasabi/api/script/objects/c_script/c_dropdownlist.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_DROPDOWNLIST_H
|
||||
#define __C_DROPDOWNLIST_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_DROPDOWNLIST_PARENT C_GuiObject
|
||||
|
||||
class C_DropDownList : public C_DROPDOWNLIST_PARENT {
|
||||
public:
|
||||
|
||||
C_DropDownList(ScriptObject *object);
|
||||
C_DropDownList();
|
||||
virtual ~C_DropDownList();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual const wchar_t *getItemSelected();
|
||||
virtual void onSelect(int id, int hover);
|
||||
virtual void setListHeight(int h);
|
||||
virtual void openList();
|
||||
virtual void closeList();
|
||||
virtual void setItems(const wchar_t *lotsofitems);
|
||||
virtual int addItem(const wchar_t *_text);
|
||||
virtual void delItem(int id);
|
||||
virtual int findItem(const wchar_t *_text);
|
||||
virtual int getNumItems();
|
||||
virtual void selectItem(int id, int hover);
|
||||
virtual const wchar_t *getItemText(int id);
|
||||
virtual int getSelected();
|
||||
virtual const wchar_t *getSelectedText();
|
||||
virtual const wchar_t *getCustomText();
|
||||
virtual void deleteAllItems();
|
||||
virtual void setNoItemText(const wchar_t *txt);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int getitemselected_id;
|
||||
static int onselect_id;
|
||||
static int setlistheight_id;
|
||||
static int openlist_id;
|
||||
static int closelist_id;
|
||||
static int setitems_id;
|
||||
static int additem_id;
|
||||
static int delitem_id;
|
||||
static int finditem_id;
|
||||
static int getnumitems_id;
|
||||
static int selectitem_id;
|
||||
static int getitemtext_id;
|
||||
static int getselected_id;
|
||||
static int getselectedtext_id;
|
||||
static int getcustomtext_id;
|
||||
static int deleteallitems_id;
|
||||
static int setnoitemtext_id;
|
||||
};
|
||||
|
||||
#endif
|
135
Src/Wasabi/api/script/objects/c_script/c_edit.cpp
Normal file
135
Src/Wasabi/api/script/objects/c_script/c_edit.cpp
Normal file
|
@ -0,0 +1,135 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_edit.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Edit::C_Edit(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Edit::C_Edit() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Edit::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, editGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
onenter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEnter", this);
|
||||
onabort_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onAbort", this);
|
||||
onidleeditupdate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onIdleEditUpdate", this);
|
||||
oneditupdate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEditUpdate", this);
|
||||
settext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setText", this);
|
||||
setautoenter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAutoEnter", this);
|
||||
getautoenter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoEnter", this);
|
||||
gettext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getText", this);
|
||||
selectall_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectAll", this);
|
||||
enter_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enter", this);
|
||||
setidleenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setIdleEnabled", this);
|
||||
getidleenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getIdleEnabled", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Edit::~C_Edit() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Edit::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_EDIT_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Edit::onEnter() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onenter_id, NULL);
|
||||
}
|
||||
|
||||
void C_Edit::onAbort() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onabort_id, NULL);
|
||||
}
|
||||
|
||||
void C_Edit::onIdleEditUpdate() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onidleeditupdate_id, NULL);
|
||||
}
|
||||
|
||||
void C_Edit::onEditUpdate() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), oneditupdate_id, NULL);
|
||||
}
|
||||
|
||||
void C_Edit::setText(const wchar_t *txt)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(txt);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settext_id, params);
|
||||
}
|
||||
|
||||
void C_Edit::setAutoEnter(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setautoenter_id, params);
|
||||
}
|
||||
|
||||
int C_Edit::getAutoEnter() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautoenter_id, NULL));
|
||||
}
|
||||
|
||||
const wchar_t *C_Edit::getText()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettext_id, NULL));
|
||||
}
|
||||
|
||||
void C_Edit::selectAll() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectall_id, NULL);
|
||||
}
|
||||
|
||||
void C_Edit::enter() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), enter_id, NULL);
|
||||
}
|
||||
|
||||
void C_Edit::setIdleEnabled(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setidleenabled_id, params);
|
||||
}
|
||||
|
||||
int C_Edit::getIdleEnabled() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getidleenabled_id, NULL));
|
||||
}
|
||||
|
||||
int C_Edit::loaded=0;
|
||||
int C_Edit::onenter_id=0;
|
||||
int C_Edit::onabort_id=0;
|
||||
int C_Edit::onidleeditupdate_id=0;
|
||||
int C_Edit::oneditupdate_id=0;
|
||||
int C_Edit::settext_id=0;
|
||||
int C_Edit::setautoenter_id=0;
|
||||
int C_Edit::getautoenter_id=0;
|
||||
int C_Edit::gettext_id=0;
|
||||
int C_Edit::selectall_id=0;
|
||||
int C_Edit::enter_id=0;
|
||||
int C_Edit::setidleenabled_id=0;
|
||||
int C_Edit::getidleenabled_id=0;
|
53
Src/Wasabi/api/script/objects/c_script/c_edit.h
Normal file
53
Src/Wasabi/api/script/objects/c_script/c_edit.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_EDIT_H
|
||||
#define __C_EDIT_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_EDIT_PARENT C_GuiObject
|
||||
|
||||
class C_Edit : public C_EDIT_PARENT {
|
||||
public:
|
||||
|
||||
C_Edit(ScriptObject *object);
|
||||
C_Edit();
|
||||
virtual ~C_Edit();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onEnter();
|
||||
virtual void onAbort();
|
||||
virtual void onIdleEditUpdate();
|
||||
virtual void onEditUpdate();
|
||||
virtual void setText(const wchar_t *txt);
|
||||
virtual void setAutoEnter(int onoff);
|
||||
virtual int getAutoEnter();
|
||||
virtual const wchar_t *getText();
|
||||
virtual void selectAll();
|
||||
virtual void enter();
|
||||
virtual void setIdleEnabled(int onoff);
|
||||
virtual int getIdleEnabled();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onenter_id;
|
||||
static int onabort_id;
|
||||
static int onidleeditupdate_id;
|
||||
static int oneditupdate_id;
|
||||
static int settext_id;
|
||||
static int setautoenter_id;
|
||||
static int getautoenter_id;
|
||||
static int gettext_id;
|
||||
static int selectall_id;
|
||||
static int enter_id;
|
||||
static int setidleenabled_id;
|
||||
static int getidleenabled_id;
|
||||
};
|
||||
|
||||
#endif
|
99
Src/Wasabi/api/script/objects/c_script/c_group.cpp
Normal file
99
Src/Wasabi/api/script/objects/c_script/c_group.cpp
Normal file
|
@ -0,0 +1,99 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_group.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Group::C_Group(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Group::C_Group() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Group::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, groupGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
getobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getObject", this);
|
||||
getnumobjects_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumObjects", this);
|
||||
enumobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumObject", this);
|
||||
oncreateobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onCreateObject", this);
|
||||
getmouseposx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getMousePosX", this);
|
||||
getmouseposy_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getMousePosY", this);
|
||||
islayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isLayout", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Group::~C_Group() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Group::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_GROUP_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
ScriptObject *C_Group::getObject(const wchar_t *object_id)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(object_id);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getobject_id, params));
|
||||
}
|
||||
|
||||
int C_Group::getNumObjects() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumobjects_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_Group::enumObject(int num) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(num);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumobject_id, params));
|
||||
}
|
||||
|
||||
void C_Group::onCreateObject(ScriptObject *newobj) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(newobj);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncreateobject_id, params);
|
||||
}
|
||||
|
||||
int C_Group::getMousePosX() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getmouseposx_id, NULL));
|
||||
}
|
||||
|
||||
int C_Group::getMousePosY() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getmouseposy_id, NULL));
|
||||
}
|
||||
|
||||
int C_Group::isLayout() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), islayout_id, NULL));
|
||||
}
|
||||
|
||||
int C_Group::loaded=0;
|
||||
int C_Group::getobject_id=0;
|
||||
int C_Group::getnumobjects_id=0;
|
||||
int C_Group::enumobject_id=0;
|
||||
int C_Group::oncreateobject_id=0;
|
||||
int C_Group::getmouseposx_id=0;
|
||||
int C_Group::getmouseposy_id=0;
|
||||
int C_Group::islayout_id=0;
|
43
Src/Wasabi/api/script/objects/c_script/c_group.h
Normal file
43
Src/Wasabi/api/script/objects/c_script/c_group.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_GROUP_H
|
||||
#define __C_GROUP_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_GROUP_PARENT C_GuiObject
|
||||
|
||||
class C_Group : public C_GROUP_PARENT {
|
||||
public:
|
||||
|
||||
C_Group(ScriptObject *object);
|
||||
C_Group();
|
||||
virtual ~C_Group();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual ScriptObject *getObject(const wchar_t *object_id);
|
||||
virtual int getNumObjects();
|
||||
virtual ScriptObject *enumObject(int num);
|
||||
virtual void onCreateObject(ScriptObject *newobj);
|
||||
virtual int getMousePosX();
|
||||
virtual int getMousePosY();
|
||||
virtual int isLayout();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int getobject_id;
|
||||
static int getnumobjects_id;
|
||||
static int enumobject_id;
|
||||
static int oncreateobject_id;
|
||||
static int getmouseposx_id;
|
||||
static int getmouseposy_id;
|
||||
static int islayout_id;
|
||||
};
|
||||
|
||||
#endif
|
85
Src/Wasabi/api/script/objects/c_script/c_grouplist.cpp
Normal file
85
Src/Wasabi/api/script/objects/c_script/c_grouplist.cpp
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
#include <api/api.h>
|
||||
#include "c_grouplist.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_GroupList::C_GroupList(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_GroupList::C_GroupList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_GroupList::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, groupListGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
instantiate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"instantiate", this);
|
||||
getnumitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumItems", this);
|
||||
enumitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumItem", this);
|
||||
removeall_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"removeAll", this);
|
||||
scrolltopercent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollToPercent", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_GroupList::~C_GroupList() {
|
||||
}
|
||||
|
||||
ScriptObject *C_GroupList::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_GROUPLIST_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
ScriptObject *C_GroupList::instantiate(const char *group_id, int num_groups) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(group_id);
|
||||
scriptVar b = MAKE_SCRIPT_INT(num_groups);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), instantiate_id, params));
|
||||
}
|
||||
|
||||
int C_GroupList::getNumItems() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumitems_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GroupList::enumItem(int num) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(num);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumitem_id, params));
|
||||
}
|
||||
|
||||
void C_GroupList::removeAll() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), removeall_id, NULL);
|
||||
}
|
||||
|
||||
void C_GroupList::scrollToPercent(int percent) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(percent);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrolltopercent_id, params);
|
||||
}
|
||||
|
||||
int C_GroupList::loaded=0;
|
||||
int C_GroupList::instantiate_id=0;
|
||||
int C_GroupList::getnumitems_id=0;
|
||||
int C_GroupList::enumitem_id=0;
|
||||
int C_GroupList::removeall_id=0;
|
||||
int C_GroupList::scrolltopercent_id=0;
|
39
Src/Wasabi/api/script/objects/c_script/c_grouplist.h
Normal file
39
Src/Wasabi/api/script/objects/c_script/c_grouplist.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_GROUPLIST_H
|
||||
#define __C_GROUPLIST_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_GROUPLIST_PARENT C_GuiObject
|
||||
|
||||
class C_GroupList : public C_GROUPLIST_PARENT {
|
||||
public:
|
||||
|
||||
C_GroupList(ScriptObject *object);
|
||||
C_GroupList();
|
||||
virtual ~C_GroupList();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual ScriptObject *instantiate(const char *group_id, int num_groups);
|
||||
virtual int getNumItems();
|
||||
virtual ScriptObject *enumItem(int num);
|
||||
virtual void removeAll();
|
||||
virtual void scrollToPercent(int percent);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int instantiate_id;
|
||||
static int getnumitems_id;
|
||||
static int enumitem_id;
|
||||
static int removeall_id;
|
||||
static int scrolltopercent_id;
|
||||
};
|
||||
|
||||
#endif
|
722
Src/Wasabi/api/script/objects/c_script/c_guilist.cpp
Normal file
722
Src/Wasabi/api/script/objects/c_script/c_guilist.cpp
Normal file
|
@ -0,0 +1,722 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_guilist.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_GuiList::C_GuiList(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_GuiList::C_GuiList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_GuiList::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, guiListGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
getnumitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumItems", this);
|
||||
getwantautodeselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getWantAutoDeselect", this);
|
||||
setwantautodeselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setWantAutoDeselect", this);
|
||||
onsetvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSetVisible", this);
|
||||
setautosort_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAutoSort", this);
|
||||
next_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"next", this);
|
||||
selectcurrent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectCurrent", this);
|
||||
selectfirstentry_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectFirstEntry", this);
|
||||
previous_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"previous", this);
|
||||
pagedown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"pagedown", this);
|
||||
pageup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"pageup", this);
|
||||
home_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"home", this);
|
||||
end_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"end", this);
|
||||
reset_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"reset", this);
|
||||
addcolumn_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"addColumn", this);
|
||||
getnumcolumns_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumColumns", this);
|
||||
getcolumnwidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getColumnWidth", this);
|
||||
setcolumnwidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setColumnWidth", this);
|
||||
getcolumnlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getColumnLabel", this);
|
||||
setcolumnlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setColumnLabel", this);
|
||||
getcolumnnumeric_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getColumnNumeric", this);
|
||||
setcolumndynamic_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setColumnDynamic", this);
|
||||
iscolumndynamic_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isColumnDynamic", this);
|
||||
setminimumsize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setMinimumSize", this);
|
||||
additem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"addItem", this);
|
||||
insertitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"insertItem", this);
|
||||
getlastaddeditempos_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLastAddedItemPos", this);
|
||||
setsubitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSubItem", this);
|
||||
deleteallitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"deleteAllItems", this);
|
||||
deletebypos_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"deleteByPos", this);
|
||||
getitemlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemLabel", this);
|
||||
setitemlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setItemLabel", this);
|
||||
getitemselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemSelected", this);
|
||||
isitemfocused_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isItemFocused", this);
|
||||
getitemfocused_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemFocused", this);
|
||||
setitemfocused_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setItemFocused", this);
|
||||
ensureitemvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"ensureItemVisible", this);
|
||||
invalidatecolumns_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"invalidateColumns", this);
|
||||
scrollabsolute_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollAbsolute", this);
|
||||
scrollrelative_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollRelative", this);
|
||||
scrollleft_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollLeft", this);
|
||||
scrollright_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollRight", this);
|
||||
scrollup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollUp", this);
|
||||
scrolldown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollDown", this);
|
||||
getsubitemtext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSubitemText", this);
|
||||
getfirstitemselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getFirstItemSelected", this);
|
||||
getnextitemselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNextItemSelected", this);
|
||||
selectall_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectAll", this);
|
||||
deselectall_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"deselectAll", this);
|
||||
invertselection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"invertSelection", this);
|
||||
invalidateitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"invalidateItem", this);
|
||||
getfirstitemvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getFirstItemVisible", this);
|
||||
getlastitemvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLastItemVisible", this);
|
||||
setfontsize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setFontSize", this);
|
||||
getfontsize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getFontSize", this);
|
||||
jumptonext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"jumpToNext", this);
|
||||
scrolltoitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"scrollToItem", this);
|
||||
resort_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"resort", this);
|
||||
getsortdirection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSortDirection", this);
|
||||
getsortcolumn_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSortColumn", this);
|
||||
setsortcolumn_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSortColumn", this);
|
||||
setsortdirection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSortDirection", this);
|
||||
getitemcount_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemCount", this);
|
||||
setselectionstart_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSelectionStart", this);
|
||||
setselectionend_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSelectionEnd", this);
|
||||
setselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSelected", this);
|
||||
toggleselection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"toggleSelection", this);
|
||||
getheaderheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getHeaderHeight", this);
|
||||
getpreventmultipleselection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getPreventMultipleSelection", this);
|
||||
setpreventmultipleselection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setPreventMultipleSelection", this);
|
||||
moveitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"moveItem", this);
|
||||
onselectall_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSelectAll", this);
|
||||
ondelete_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDelete", this);
|
||||
ondoubleclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDoubleClick", this);
|
||||
onleftclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftClick", this);
|
||||
onsecondleftclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSecondLeftClick", this);
|
||||
onrightclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightClick", this);
|
||||
oncolumndblclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onColumnDblClick", this);
|
||||
oncolumnlabelclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onColumnLabelClick", this);
|
||||
onitemselection_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onItemSelection", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_GuiList::~C_GuiList() {
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiList::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_GUILIST_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
int C_GuiList::getNumItems() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumitems_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::getWantAutoDeselect() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getwantautodeselect_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiList::setWantAutoDeselect(int want) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(want);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setwantautodeselect_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::onSetVisible(int show) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(show);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsetvisible_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::setAutoSort(int dosort) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(dosort);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setautosort_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::next() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), next_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::selectCurrent() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectcurrent_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::selectFirstEntry() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectfirstentry_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::previous() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), previous_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::pagedown() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), pagedown_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::pageup() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), pageup_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::home() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), home_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::end() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), end_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::reset() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), reset_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiList::addColumn(const wchar_t *name, int width, int numeric)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(name);
|
||||
scriptVar b = MAKE_SCRIPT_INT(width);
|
||||
scriptVar c = MAKE_SCRIPT_INT(numeric);
|
||||
scriptVar *params[3] = {&a, &b, &c};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), addcolumn_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::getNumColumns() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumcolumns_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::getColumnWidth(int column) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcolumnwidth_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::setColumnWidth(int column, int newwidth) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar b = MAKE_SCRIPT_INT(newwidth);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setcolumnwidth_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_GuiList::getColumnLabel(int column) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcolumnlabel_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::setColumnLabel(int column, const wchar_t *newlabel) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(newlabel);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setcolumnlabel_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::getColumnNumeric(int column) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcolumnnumeric_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::setColumnDynamic(int column, int isdynamic) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar b = MAKE_SCRIPT_INT(isdynamic);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setcolumndynamic_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::isColumnDynamic(int column) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(column);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), iscolumndynamic_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::setMinimumSize(int size) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(size);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setminimumsize_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::addItem(const wchar_t *label)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(label);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), additem_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::insertItem(int pos, const wchar_t *label) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(label);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), insertitem_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::getLastAddedItemPos() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getlastaddeditempos_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiList::setSubItem(int pos, int subpos, const wchar_t *txt) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_INT(subpos);
|
||||
scriptVar c = MAKE_SCRIPT_STRING(txt);
|
||||
scriptVar *params[3] = {&a, &b, &c};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setsubitem_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::deleteAllItems() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), deleteallitems_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiList::deleteByPos(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), deletebypos_id, params));
|
||||
}
|
||||
|
||||
const wchar_t *C_GuiList::getItemLabel(int pos, int subpos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_INT(subpos);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemlabel_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::setItemLabel(int pos, const wchar_t *_text) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(_text);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setitemlabel_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::getItemSelected(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemselected_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::isItemFocused(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isitemfocused_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::getItemFocused() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemfocused_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiList::setItemFocused(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setitemfocused_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::ensureItemVisible(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ensureitemvisible_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::invalidateColumns() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), invalidatecolumns_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiList::scrollAbsolute(int x) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrollabsolute_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::scrollRelative(int x) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrollrelative_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::scrollLeft(int lines) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(lines);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrollleft_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::scrollRight(int lines) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(lines);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrollright_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::scrollUp(int lines) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(lines);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrollup_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::scrollDown(int lines) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(lines);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrolldown_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_GuiList::getSubitemText(int pos, int subpos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_INT(subpos);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsubitemtext_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::getFirstItemSelected() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getfirstitemselected_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::getNextItemSelected(int lastpos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(lastpos);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnextitemselected_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::selectAll() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectall_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::deselectAll() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), deselectall_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::invertSelection() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), invertselection_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::invalidateItem(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), invalidateitem_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::getFirstItemVisible() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getfirstitemvisible_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::getLastItemVisible() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getlastitemvisible_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::setFontSize(int size) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(size);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), setfontsize_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::getFontSize() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getfontsize_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiList::jumpToNext(int c) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(c);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), jumptonext_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::scrollToItem(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), scrolltoitem_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::resort() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), resort_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiList::getSortDirection() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsortdirection_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::getSortColumn() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsortcolumn_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiList::setSortColumn(int col) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(col);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setsortcolumn_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::setSortDirection(int dir) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(dir);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setsortdirection_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::getItemCount() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemcount_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiList::setSelectionStart(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setselectionstart_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::setSelectionEnd(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setselectionend_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::setSelected(int pos, int selected) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_INT(selected);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setselected_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::toggleSelection(int pos, int setfocus) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar b = MAKE_SCRIPT_INT(setfocus);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), toggleselection_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::getHeaderHeight() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getheaderheight_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::getPreventMultipleSelection() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getpreventmultipleselection_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiList::setPreventMultipleSelection(int val) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(val);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), setpreventmultipleselection_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::moveItem(int from, int to) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(from);
|
||||
scriptVar b = MAKE_SCRIPT_INT(to);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), moveitem_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::onSelectAll() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onselectall_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::onDelete() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondelete_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiList::onDoubleClick(int itemnum) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(itemnum);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondoubleclick_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::onLeftClick(int itemnum) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(itemnum);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftclick_id, params);
|
||||
}
|
||||
|
||||
void C_GuiList::onSecondLeftClick(int itemnum) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(itemnum);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsecondleftclick_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::onRightClick(int itemnum) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(itemnum);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightclick_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::onColumnDblClick(int col, int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(col);
|
||||
scriptVar b = MAKE_SCRIPT_INT(x);
|
||||
scriptVar c = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[3] = {&a, &b, &c};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncolumndblclick_id, params));
|
||||
}
|
||||
|
||||
int C_GuiList::onColumnLabelClick(int col, int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(col);
|
||||
scriptVar b = MAKE_SCRIPT_INT(x);
|
||||
scriptVar c = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[3] = {&a, &b, &c};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncolumnlabelclick_id, params));
|
||||
}
|
||||
|
||||
void C_GuiList::onItemSelection(int itemnum, int selected) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(itemnum);
|
||||
scriptVar b = MAKE_SCRIPT_INT(selected);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onitemselection_id, params);
|
||||
}
|
||||
|
||||
int C_GuiList::loaded=0;
|
||||
int C_GuiList::getnumitems_id=0;
|
||||
int C_GuiList::getwantautodeselect_id=0;
|
||||
int C_GuiList::setwantautodeselect_id=0;
|
||||
int C_GuiList::onsetvisible_id=0;
|
||||
int C_GuiList::setautosort_id=0;
|
||||
int C_GuiList::next_id=0;
|
||||
int C_GuiList::selectcurrent_id=0;
|
||||
int C_GuiList::selectfirstentry_id=0;
|
||||
int C_GuiList::previous_id=0;
|
||||
int C_GuiList::pagedown_id=0;
|
||||
int C_GuiList::pageup_id=0;
|
||||
int C_GuiList::home_id=0;
|
||||
int C_GuiList::end_id=0;
|
||||
int C_GuiList::reset_id=0;
|
||||
int C_GuiList::addcolumn_id=0;
|
||||
int C_GuiList::getnumcolumns_id=0;
|
||||
int C_GuiList::getcolumnwidth_id=0;
|
||||
int C_GuiList::setcolumnwidth_id=0;
|
||||
int C_GuiList::getcolumnlabel_id=0;
|
||||
int C_GuiList::setcolumnlabel_id=0;
|
||||
int C_GuiList::getcolumnnumeric_id=0;
|
||||
int C_GuiList::setcolumndynamic_id=0;
|
||||
int C_GuiList::iscolumndynamic_id=0;
|
||||
int C_GuiList::setminimumsize_id=0;
|
||||
int C_GuiList::additem_id=0;
|
||||
int C_GuiList::insertitem_id=0;
|
||||
int C_GuiList::getlastaddeditempos_id=0;
|
||||
int C_GuiList::setsubitem_id=0;
|
||||
int C_GuiList::deleteallitems_id=0;
|
||||
int C_GuiList::deletebypos_id=0;
|
||||
int C_GuiList::getitemlabel_id=0;
|
||||
int C_GuiList::setitemlabel_id=0;
|
||||
int C_GuiList::getitemselected_id=0;
|
||||
int C_GuiList::isitemfocused_id=0;
|
||||
int C_GuiList::getitemfocused_id=0;
|
||||
int C_GuiList::setitemfocused_id=0;
|
||||
int C_GuiList::ensureitemvisible_id=0;
|
||||
int C_GuiList::invalidatecolumns_id=0;
|
||||
int C_GuiList::scrollabsolute_id=0;
|
||||
int C_GuiList::scrollrelative_id=0;
|
||||
int C_GuiList::scrollleft_id=0;
|
||||
int C_GuiList::scrollright_id=0;
|
||||
int C_GuiList::scrollup_id=0;
|
||||
int C_GuiList::scrolldown_id=0;
|
||||
int C_GuiList::getsubitemtext_id=0;
|
||||
int C_GuiList::getfirstitemselected_id=0;
|
||||
int C_GuiList::getnextitemselected_id=0;
|
||||
int C_GuiList::selectall_id=0;
|
||||
int C_GuiList::deselectall_id=0;
|
||||
int C_GuiList::invertselection_id=0;
|
||||
int C_GuiList::invalidateitem_id=0;
|
||||
int C_GuiList::getfirstitemvisible_id=0;
|
||||
int C_GuiList::getlastitemvisible_id=0;
|
||||
int C_GuiList::setfontsize_id=0;
|
||||
int C_GuiList::getfontsize_id=0;
|
||||
int C_GuiList::jumptonext_id=0;
|
||||
int C_GuiList::scrolltoitem_id=0;
|
||||
int C_GuiList::resort_id=0;
|
||||
int C_GuiList::getsortdirection_id=0;
|
||||
int C_GuiList::getsortcolumn_id=0;
|
||||
int C_GuiList::setsortcolumn_id=0;
|
||||
int C_GuiList::setsortdirection_id=0;
|
||||
int C_GuiList::getitemcount_id=0;
|
||||
int C_GuiList::setselectionstart_id=0;
|
||||
int C_GuiList::setselectionend_id=0;
|
||||
int C_GuiList::setselected_id=0;
|
||||
int C_GuiList::toggleselection_id=0;
|
||||
int C_GuiList::getheaderheight_id=0;
|
||||
int C_GuiList::getpreventmultipleselection_id=0;
|
||||
int C_GuiList::setpreventmultipleselection_id=0;
|
||||
int C_GuiList::moveitem_id=0;
|
||||
int C_GuiList::onselectall_id=0;
|
||||
int C_GuiList::ondelete_id=0;
|
||||
int C_GuiList::ondoubleclick_id=0;
|
||||
int C_GuiList::onleftclick_id=0;
|
||||
int C_GuiList::onsecondleftclick_id=0;
|
||||
int C_GuiList::onrightclick_id=0;
|
||||
int C_GuiList::oncolumndblclick_id=0;
|
||||
int C_GuiList::oncolumnlabelclick_id=0;
|
||||
int C_GuiList::onitemselection_id=0;
|
189
Src/Wasabi/api/script/objects/c_script/c_guilist.h
Normal file
189
Src/Wasabi/api/script/objects/c_script/c_guilist.h
Normal file
|
@ -0,0 +1,189 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_GUILIST_H
|
||||
#define __C_GUILIST_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_GUILIST_PARENT C_GuiObject
|
||||
|
||||
class C_GuiList : public C_GUILIST_PARENT {
|
||||
public:
|
||||
|
||||
C_GuiList(ScriptObject *object);
|
||||
C_GuiList();
|
||||
virtual ~C_GuiList();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual int getNumItems();
|
||||
virtual int getWantAutoDeselect();
|
||||
virtual void setWantAutoDeselect(int want);
|
||||
virtual void onSetVisible(int show);
|
||||
virtual void setAutoSort(int dosort);
|
||||
virtual void next();
|
||||
virtual void selectCurrent();
|
||||
virtual void selectFirstEntry();
|
||||
virtual void previous();
|
||||
virtual void pagedown();
|
||||
virtual void pageup();
|
||||
virtual void home();
|
||||
virtual void end();
|
||||
virtual void reset();
|
||||
virtual int addColumn(const wchar_t *name, int width, int numeric);
|
||||
virtual int getNumColumns();
|
||||
virtual int getColumnWidth(int column);
|
||||
virtual void setColumnWidth(int column, int newwidth);
|
||||
virtual const wchar_t *getColumnLabel(int column);
|
||||
virtual void setColumnLabel(int column, const wchar_t *newlabel);
|
||||
virtual int getColumnNumeric(int column);
|
||||
virtual void setColumnDynamic(int column, int isdynamic);
|
||||
virtual int isColumnDynamic(int column);
|
||||
virtual void setMinimumSize(int size);
|
||||
virtual int addItem(const wchar_t *label);
|
||||
virtual int insertItem(int pos, const wchar_t *label);
|
||||
virtual int getLastAddedItemPos();
|
||||
virtual void setSubItem(int pos, int subpos, const wchar_t *txt);
|
||||
virtual void deleteAllItems();
|
||||
virtual int deleteByPos(int pos);
|
||||
virtual const wchar_t *getItemLabel(int pos, int subpos);
|
||||
virtual void setItemLabel(int pos, const wchar_t *_text);
|
||||
virtual int getItemSelected(int pos);
|
||||
virtual int isItemFocused(int pos);
|
||||
virtual int getItemFocused();
|
||||
virtual void setItemFocused(int pos);
|
||||
virtual void ensureItemVisible(int pos);
|
||||
virtual void invalidateColumns();
|
||||
virtual int scrollAbsolute(int x);
|
||||
virtual int scrollRelative(int x);
|
||||
virtual void scrollLeft(int lines);
|
||||
virtual void scrollRight(int lines);
|
||||
virtual void scrollUp(int lines);
|
||||
virtual void scrollDown(int lines);
|
||||
virtual const wchar_t *getSubitemText(int pos, int subpos);
|
||||
virtual int getFirstItemSelected();
|
||||
virtual int getNextItemSelected(int lastpos);
|
||||
virtual int selectAll();
|
||||
virtual int deselectAll();
|
||||
virtual int invertSelection();
|
||||
virtual int invalidateItem(int pos);
|
||||
virtual int getFirstItemVisible();
|
||||
virtual int getLastItemVisible();
|
||||
virtual int setFontSize(int size);
|
||||
virtual int getFontSize();
|
||||
virtual void jumpToNext(int c);
|
||||
virtual void scrollToItem(int pos);
|
||||
virtual void resort();
|
||||
virtual int getSortDirection();
|
||||
virtual int getSortColumn();
|
||||
virtual void setSortColumn(int col);
|
||||
virtual void setSortDirection(int dir);
|
||||
virtual int getItemCount();
|
||||
virtual void setSelectionStart(int pos);
|
||||
virtual void setSelectionEnd(int pos);
|
||||
virtual void setSelected(int pos, int selected);
|
||||
virtual void toggleSelection(int pos, int setfocus);
|
||||
virtual int getHeaderHeight();
|
||||
virtual int getPreventMultipleSelection();
|
||||
virtual int setPreventMultipleSelection(int val);
|
||||
virtual void moveItem(int from, int to);
|
||||
virtual void onSelectAll();
|
||||
virtual void onDelete();
|
||||
virtual void onDoubleClick(int itemnum);
|
||||
virtual void onLeftClick(int itemnum);
|
||||
virtual void onSecondLeftClick(int itemnum);
|
||||
virtual int onRightClick(int itemnum);
|
||||
virtual int onColumnDblClick(int col, int x, int y);
|
||||
virtual int onColumnLabelClick(int col, int x, int y);
|
||||
virtual void onItemSelection(int itemnum, int selected);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int getnumitems_id;
|
||||
static int getwantautodeselect_id;
|
||||
static int setwantautodeselect_id;
|
||||
static int onsetvisible_id;
|
||||
static int setautosort_id;
|
||||
static int next_id;
|
||||
static int selectcurrent_id;
|
||||
static int selectfirstentry_id;
|
||||
static int previous_id;
|
||||
static int pagedown_id;
|
||||
static int pageup_id;
|
||||
static int home_id;
|
||||
static int end_id;
|
||||
static int reset_id;
|
||||
static int addcolumn_id;
|
||||
static int getnumcolumns_id;
|
||||
static int getcolumnwidth_id;
|
||||
static int setcolumnwidth_id;
|
||||
static int getcolumnlabel_id;
|
||||
static int setcolumnlabel_id;
|
||||
static int getcolumnnumeric_id;
|
||||
static int setcolumndynamic_id;
|
||||
static int iscolumndynamic_id;
|
||||
static int setminimumsize_id;
|
||||
static int additem_id;
|
||||
static int insertitem_id;
|
||||
static int getlastaddeditempos_id;
|
||||
static int setsubitem_id;
|
||||
static int deleteallitems_id;
|
||||
static int deletebypos_id;
|
||||
static int getitemlabel_id;
|
||||
static int setitemlabel_id;
|
||||
static int getitemselected_id;
|
||||
static int isitemfocused_id;
|
||||
static int getitemfocused_id;
|
||||
static int setitemfocused_id;
|
||||
static int ensureitemvisible_id;
|
||||
static int invalidatecolumns_id;
|
||||
static int scrollabsolute_id;
|
||||
static int scrollrelative_id;
|
||||
static int scrollleft_id;
|
||||
static int scrollright_id;
|
||||
static int scrollup_id;
|
||||
static int scrolldown_id;
|
||||
static int getsubitemtext_id;
|
||||
static int getfirstitemselected_id;
|
||||
static int getnextitemselected_id;
|
||||
static int selectall_id;
|
||||
static int deselectall_id;
|
||||
static int invertselection_id;
|
||||
static int invalidateitem_id;
|
||||
static int getfirstitemvisible_id;
|
||||
static int getlastitemvisible_id;
|
||||
static int setfontsize_id;
|
||||
static int getfontsize_id;
|
||||
static int jumptonext_id;
|
||||
static int scrolltoitem_id;
|
||||
static int resort_id;
|
||||
static int getsortdirection_id;
|
||||
static int getsortcolumn_id;
|
||||
static int setsortcolumn_id;
|
||||
static int setsortdirection_id;
|
||||
static int getitemcount_id;
|
||||
static int setselectionstart_id;
|
||||
static int setselectionend_id;
|
||||
static int setselected_id;
|
||||
static int toggleselection_id;
|
||||
static int getheaderheight_id;
|
||||
static int getpreventmultipleselection_id;
|
||||
static int setpreventmultipleselection_id;
|
||||
static int moveitem_id;
|
||||
static int onselectall_id;
|
||||
static int ondelete_id;
|
||||
static int ondoubleclick_id;
|
||||
static int onleftclick_id;
|
||||
static int onsecondleftclick_id;
|
||||
static int onrightclick_id;
|
||||
static int oncolumndblclick_id;
|
||||
static int oncolumnlabelclick_id;
|
||||
static int onitemselection_id;
|
||||
};
|
||||
|
||||
#endif
|
739
Src/Wasabi/api/script/objects/c_script/c_guiobject.cpp
Normal file
739
Src/Wasabi/api/script/objects/c_script/c_guiobject.cpp
Normal file
|
@ -0,0 +1,739 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_guiobject.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_GuiObject::C_GuiObject(ScriptObject *object) : C_RootObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_GuiObject::C_GuiObject() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_GuiObject::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, guiObjectGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
show_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"show", this);
|
||||
hide_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hide", this);
|
||||
isvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isVisible", this);
|
||||
onsetvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSetVisible", this);
|
||||
setalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAlpha", this);
|
||||
getalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAlpha", this);
|
||||
onleftbuttonup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftButtonUp", this);
|
||||
onleftbuttondown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftButtonDown", this);
|
||||
onrightbuttonup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightButtonUp", this);
|
||||
onrightbuttondown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightButtonDown", this);
|
||||
onrightbuttondblclk_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightButtonDblClk", this);
|
||||
onleftbuttondblclk_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftButtonDblClk", this);
|
||||
onmousemove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseMove", this);
|
||||
onenterarea_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEnterArea", this);
|
||||
onleavearea_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeaveArea", this);
|
||||
setenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setEnabled", this);
|
||||
getenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getEnabled", this);
|
||||
onenable_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEnable", this);
|
||||
resize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"resize", this);
|
||||
onresize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onResize", this);
|
||||
ismouseover_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isMouseOver", this);
|
||||
getleft_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLeft", this);
|
||||
gettop_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTop", this);
|
||||
getwidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getWidth", this);
|
||||
getheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getHeight", this);
|
||||
settargetx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetX", this);
|
||||
settargety_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetY", this);
|
||||
settargetw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetW", this);
|
||||
settargeth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetH", this);
|
||||
settargeta_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetA", this);
|
||||
settargetspeed_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetSpeed", this);
|
||||
gototarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"gotoTarget", this);
|
||||
ontargetreached_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTargetReached", this);
|
||||
canceltarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"cancelTarget", this);
|
||||
reversetarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"reverseTarget", this);
|
||||
onstartup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onStartup", this);
|
||||
isgoingtotarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isGoingToTarget", this);
|
||||
setxmlparam_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setXmlParam", this);
|
||||
getxmlparam_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getXmlParam", this);
|
||||
init_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"init", this);
|
||||
bringtofront_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringToFront", this);
|
||||
bringtoback_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringToBack", this);
|
||||
bringabove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringAbove", this);
|
||||
bringbelow_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringBelow", this);
|
||||
getguix_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiX", this);
|
||||
getguiy_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiY", this);
|
||||
getguiw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiW", this);
|
||||
getguih_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiH", this);
|
||||
getguirelatx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatX", this);
|
||||
getguirelaty_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatY", this);
|
||||
getguirelatw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatW", this);
|
||||
getguirelath_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatH", this);
|
||||
isactive_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isActive", this);
|
||||
getparent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getParent", this);
|
||||
getparentlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getParentLayout", this);
|
||||
gettopparent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTopParent", this);
|
||||
runmodal_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"runModal", this);
|
||||
endmodal_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"endModal", this);
|
||||
findobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"findObject", this);
|
||||
findobjectxy_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"findObjectXY", this);
|
||||
getname_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getName", this);
|
||||
clienttoscreenx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenX", this);
|
||||
clienttoscreeny_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenY", this);
|
||||
clienttoscreenw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenW", this);
|
||||
clienttoscreenh_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenH", this);
|
||||
screentoclientx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientX", this);
|
||||
screentoclienty_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientY", this);
|
||||
screentoclientw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientW", this);
|
||||
screentoclienth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientH", this);
|
||||
getautowidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoWidth", this);
|
||||
getautoheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoHeight", this);
|
||||
setfocus_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setFocus", this);
|
||||
onchar_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onChar", this);
|
||||
onaccelerator_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onAccelerator", this);
|
||||
ismouseoverrect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isMouseOverRect", this);
|
||||
getinterface_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getInterface", this);
|
||||
onkeydown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onKeyDown", this);
|
||||
onkeyup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onKeyUp", this);
|
||||
ongetfocus_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onGetFocus", this);
|
||||
onkillfocus_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onKillFocus", this);
|
||||
sendaction_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"sendAction", this);
|
||||
onaction_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onAction", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_GuiObject::~C_GuiObject() {
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_GUIOBJECT_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_GuiObject::show() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), show_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::hide() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), hide_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiObject::isVisible() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isvisible_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::onSetVisible(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsetvisible_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::setAlpha(int alpha) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(alpha);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setalpha_id, params);
|
||||
}
|
||||
|
||||
int C_GuiObject::getAlpha() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getalpha_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::onLeftButtonUp(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftbuttonup_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onLeftButtonDown(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftbuttondown_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onRightButtonUp(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightbuttonup_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onRightButtonDown(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightbuttondown_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onRightButtonDblClk(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightbuttondblclk_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onLeftButtonDblClk(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftbuttondblclk_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onMouseMove(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmousemove_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onEnterArea() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onenterarea_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::onLeaveArea() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleavearea_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::setEnabled(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setenabled_id, params);
|
||||
}
|
||||
|
||||
int C_GuiObject::getEnabled() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getenabled_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::onEnable(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onenable_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::resize(int x, int y, int w, int h) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar c = MAKE_SCRIPT_INT(w);
|
||||
scriptVar d = MAKE_SCRIPT_INT(h);
|
||||
scriptVar *params[4] = {&a, &b, &c, &d};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), resize_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onResize(int x, int y, int w, int h) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar c = MAKE_SCRIPT_INT(w);
|
||||
scriptVar d = MAKE_SCRIPT_INT(h);
|
||||
scriptVar *params[4] = {&a, &b, &c, &d};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onresize_id, params);
|
||||
}
|
||||
|
||||
int C_GuiObject::isMouseOver(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ismouseover_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::getLeft() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getleft_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getTop() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettop_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getWidth() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getwidth_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getHeight() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getheight_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::setTargetX(int x) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetx_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::setTargetY(int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargety_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::setTargetW(int w) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(w);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetw_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::setTargetH(int r) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(r);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargeth_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::setTargetA(int alpha) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(alpha);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargeta_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::setTargetSpeed(float insecond) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_FLOAT(insecond);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetspeed_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::gotoTarget() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), gototarget_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::onTargetReached() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontargetreached_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::cancelTarget() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), canceltarget_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::reverseTarget(int reverse) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(reverse);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), reversetarget_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onStartup() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onstartup_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiObject::isGoingToTarget() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isgoingtotarget_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::setXmlParam(const wchar_t *param, const wchar_t *value)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(param);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(value);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setxmlparam_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_GuiObject::getXmlParam(const wchar_t *param)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(param);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getxmlparam_id, params));
|
||||
}
|
||||
|
||||
void C_GuiObject::init(ScriptObject *parent) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(parent);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), init_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::bringToFront() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringtofront_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::bringToBack() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringtoback_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::bringAbove(ScriptObject *guiobj) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(guiobj);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringabove_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::bringBelow(ScriptObject *guiobj) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(guiobj);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringbelow_id, params);
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiX() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguix_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiY() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguiy_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiW() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguiw_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiH() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguih_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiRelatX() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelatx_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiRelatY() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelaty_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiRelatW() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelatw_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getGuiRelatH() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelath_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::isActive() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isactive_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::getParent() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getparent_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::getParentLayout() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getparentlayout_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::getTopParent() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettopparent_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::runModal() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), runmodal_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::endModal(int retcode) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(retcode);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), endmodal_id, params);
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::findObject(const wchar_t *id)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(id);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), findobject_id, params));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::findObjectXY(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), findobjectxy_id, params));
|
||||
}
|
||||
|
||||
const wchar_t *C_GuiObject::getName()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getname_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::clientToScreenX(int x) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreenx_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::clientToScreenY(int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreeny_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::clientToScreenW(int w) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(w);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreenw_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::clientToScreenH(int h) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(h);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreenh_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::screenToClientX(int x) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclientx_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::screenToClientY(int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclienty_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::screenToClientW(int w) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(w);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclientw_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::screenToClientH(int h) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(h);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclienth_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::getAutoWidth() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautowidth_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiObject::getAutoHeight() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautoheight_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiObject::setFocus() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setfocus_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::onChar(const wchar_t *c)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(c);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onchar_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onAccelerator(const wchar_t *accel) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(accel);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onaccelerator_id, params);
|
||||
}
|
||||
|
||||
int C_GuiObject::isMouseOverRect() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ismouseoverrect_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiObject::getInterface(const wchar_t *interface_guid)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(interface_guid);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getinterface_id, params));
|
||||
}
|
||||
|
||||
void C_GuiObject::onKeyDown(int vk_code) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(vk_code);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onkeydown_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onKeyUp(int vk_code) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(vk_code);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onkeyup_id, params);
|
||||
}
|
||||
|
||||
void C_GuiObject::onGetFocus() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ongetfocus_id, NULL);
|
||||
}
|
||||
|
||||
void C_GuiObject::onKillFocus() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onkillfocus_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiObject::sendAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(action);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(param);
|
||||
scriptVar c = MAKE_SCRIPT_INT(x);
|
||||
scriptVar d = MAKE_SCRIPT_INT(y);
|
||||
scriptVar e = MAKE_SCRIPT_INT((int)p1);
|
||||
scriptVar f = MAKE_SCRIPT_INT((int)p2);
|
||||
scriptVar *params[6] = {&a, &b, &c, &d, &e, &f};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), sendaction_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::onAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2, ScriptObject *source)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(action);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(param);
|
||||
scriptVar c = MAKE_SCRIPT_INT(x);
|
||||
scriptVar d = MAKE_SCRIPT_INT(y);
|
||||
scriptVar e = MAKE_SCRIPT_INT((int)p1);
|
||||
scriptVar f = MAKE_SCRIPT_INT((int)p2);
|
||||
scriptVar g = MAKE_SCRIPT_OBJECT(source);
|
||||
scriptVar *params[7] = {&a, &b, &c, &d, &e, &f, &g};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onaction_id, params));
|
||||
}
|
||||
|
||||
int C_GuiObject::loaded=0;
|
||||
int C_GuiObject::show_id=0;
|
||||
int C_GuiObject::hide_id=0;
|
||||
int C_GuiObject::isvisible_id=0;
|
||||
int C_GuiObject::onsetvisible_id=0;
|
||||
int C_GuiObject::setalpha_id=0;
|
||||
int C_GuiObject::getalpha_id=0;
|
||||
int C_GuiObject::onleftbuttonup_id=0;
|
||||
int C_GuiObject::onleftbuttondown_id=0;
|
||||
int C_GuiObject::onrightbuttonup_id=0;
|
||||
int C_GuiObject::onrightbuttondown_id=0;
|
||||
int C_GuiObject::onrightbuttondblclk_id=0;
|
||||
int C_GuiObject::onleftbuttondblclk_id=0;
|
||||
int C_GuiObject::onmousemove_id=0;
|
||||
int C_GuiObject::onenterarea_id=0;
|
||||
int C_GuiObject::onleavearea_id=0;
|
||||
int C_GuiObject::setenabled_id=0;
|
||||
int C_GuiObject::getenabled_id=0;
|
||||
int C_GuiObject::onenable_id=0;
|
||||
int C_GuiObject::resize_id=0;
|
||||
int C_GuiObject::onresize_id=0;
|
||||
int C_GuiObject::ismouseover_id=0;
|
||||
int C_GuiObject::getleft_id=0;
|
||||
int C_GuiObject::gettop_id=0;
|
||||
int C_GuiObject::getwidth_id=0;
|
||||
int C_GuiObject::getheight_id=0;
|
||||
int C_GuiObject::settargetx_id=0;
|
||||
int C_GuiObject::settargety_id=0;
|
||||
int C_GuiObject::settargetw_id=0;
|
||||
int C_GuiObject::settargeth_id=0;
|
||||
int C_GuiObject::settargeta_id=0;
|
||||
int C_GuiObject::settargetspeed_id=0;
|
||||
int C_GuiObject::gototarget_id=0;
|
||||
int C_GuiObject::ontargetreached_id=0;
|
||||
int C_GuiObject::canceltarget_id=0;
|
||||
int C_GuiObject::reversetarget_id=0;
|
||||
int C_GuiObject::onstartup_id=0;
|
||||
int C_GuiObject::isgoingtotarget_id=0;
|
||||
int C_GuiObject::setxmlparam_id=0;
|
||||
int C_GuiObject::getxmlparam_id=0;
|
||||
int C_GuiObject::init_id=0;
|
||||
int C_GuiObject::bringtofront_id=0;
|
||||
int C_GuiObject::bringtoback_id=0;
|
||||
int C_GuiObject::bringabove_id=0;
|
||||
int C_GuiObject::bringbelow_id=0;
|
||||
int C_GuiObject::getguix_id=0;
|
||||
int C_GuiObject::getguiy_id=0;
|
||||
int C_GuiObject::getguiw_id=0;
|
||||
int C_GuiObject::getguih_id=0;
|
||||
int C_GuiObject::getguirelatx_id=0;
|
||||
int C_GuiObject::getguirelaty_id=0;
|
||||
int C_GuiObject::getguirelatw_id=0;
|
||||
int C_GuiObject::getguirelath_id=0;
|
||||
int C_GuiObject::isactive_id=0;
|
||||
int C_GuiObject::getparent_id=0;
|
||||
int C_GuiObject::getparentlayout_id=0;
|
||||
int C_GuiObject::gettopparent_id=0;
|
||||
int C_GuiObject::runmodal_id=0;
|
||||
int C_GuiObject::endmodal_id=0;
|
||||
int C_GuiObject::findobject_id=0;
|
||||
int C_GuiObject::findobjectxy_id=0;
|
||||
int C_GuiObject::getname_id=0;
|
||||
int C_GuiObject::clienttoscreenx_id=0;
|
||||
int C_GuiObject::clienttoscreeny_id=0;
|
||||
int C_GuiObject::clienttoscreenw_id=0;
|
||||
int C_GuiObject::clienttoscreenh_id=0;
|
||||
int C_GuiObject::screentoclientx_id=0;
|
||||
int C_GuiObject::screentoclienty_id=0;
|
||||
int C_GuiObject::screentoclientw_id=0;
|
||||
int C_GuiObject::screentoclienth_id=0;
|
||||
int C_GuiObject::getautowidth_id=0;
|
||||
int C_GuiObject::getautoheight_id=0;
|
||||
int C_GuiObject::setfocus_id=0;
|
||||
int C_GuiObject::onchar_id=0;
|
||||
int C_GuiObject::onaccelerator_id=0;
|
||||
int C_GuiObject::ismouseoverrect_id=0;
|
||||
int C_GuiObject::getinterface_id=0;
|
||||
int C_GuiObject::onkeydown_id=0;
|
||||
int C_GuiObject::onkeyup_id=0;
|
||||
int C_GuiObject::ongetfocus_id=0;
|
||||
int C_GuiObject::onkillfocus_id=0;
|
||||
int C_GuiObject::sendaction_id=0;
|
||||
int C_GuiObject::onaction_id=0;
|
193
Src/Wasabi/api/script/objects/c_script/c_guiobject.h
Normal file
193
Src/Wasabi/api/script/objects/c_script/c_guiobject.h
Normal file
|
@ -0,0 +1,193 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_GUIOBJECT_H
|
||||
#define __C_GUIOBJECT_H
|
||||
|
||||
#include "c_rootobj.h"
|
||||
|
||||
#define C_GUIOBJECT_PARENT C_RootObject
|
||||
|
||||
class C_GuiObject : public C_GUIOBJECT_PARENT {
|
||||
public:
|
||||
|
||||
C_GuiObject(ScriptObject *object);
|
||||
C_GuiObject();
|
||||
virtual ~C_GuiObject();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void show();
|
||||
virtual void hide();
|
||||
virtual int isVisible();
|
||||
virtual void onSetVisible(int onoff);
|
||||
virtual void setAlpha(int alpha);
|
||||
virtual int getAlpha();
|
||||
virtual void onLeftButtonUp(int x, int y);
|
||||
virtual void onLeftButtonDown(int x, int y);
|
||||
virtual void onRightButtonUp(int x, int y);
|
||||
virtual void onRightButtonDown(int x, int y);
|
||||
virtual void onRightButtonDblClk(int x, int y);
|
||||
virtual void onLeftButtonDblClk(int x, int y);
|
||||
virtual void onMouseMove(int x, int y);
|
||||
virtual void onEnterArea();
|
||||
virtual void onLeaveArea();
|
||||
virtual void setEnabled(int onoff);
|
||||
virtual int getEnabled();
|
||||
virtual void onEnable(int onoff);
|
||||
virtual void resize(int x, int y, int w, int h);
|
||||
virtual void onResize(int x, int y, int w, int h);
|
||||
virtual int isMouseOver(int x, int y);
|
||||
virtual int getLeft();
|
||||
virtual int getTop();
|
||||
virtual int getWidth();
|
||||
virtual int getHeight();
|
||||
virtual void setTargetX(int x);
|
||||
virtual void setTargetY(int y);
|
||||
virtual void setTargetW(int w);
|
||||
virtual void setTargetH(int r);
|
||||
virtual void setTargetA(int alpha);
|
||||
virtual void setTargetSpeed(float insecond);
|
||||
virtual void gotoTarget();
|
||||
virtual void onTargetReached();
|
||||
virtual void cancelTarget();
|
||||
virtual void reverseTarget(int reverse);
|
||||
virtual void onStartup();
|
||||
virtual int isGoingToTarget();
|
||||
virtual void setXmlParam(const wchar_t *param, const wchar_t *value);
|
||||
virtual const wchar_t *getXmlParam(const wchar_t *param);
|
||||
virtual void init(ScriptObject *parent);
|
||||
virtual void bringToFront();
|
||||
virtual void bringToBack();
|
||||
virtual void bringAbove(ScriptObject *guiobj);
|
||||
virtual void bringBelow(ScriptObject *guiobj);
|
||||
virtual int getGuiX();
|
||||
virtual int getGuiY();
|
||||
virtual int getGuiW();
|
||||
virtual int getGuiH();
|
||||
virtual int getGuiRelatX();
|
||||
virtual int getGuiRelatY();
|
||||
virtual int getGuiRelatW();
|
||||
virtual int getGuiRelatH();
|
||||
virtual int isActive();
|
||||
virtual ScriptObject *getParent();
|
||||
virtual ScriptObject *getParentLayout();
|
||||
virtual ScriptObject *getTopParent();
|
||||
virtual int runModal();
|
||||
virtual void endModal(int retcode);
|
||||
virtual ScriptObject *findObject(const wchar_t *id);
|
||||
virtual ScriptObject *findObjectXY(int x, int y);
|
||||
virtual const wchar_t *getName();
|
||||
virtual int clientToScreenX(int x);
|
||||
virtual int clientToScreenY(int y);
|
||||
virtual int clientToScreenW(int w);
|
||||
virtual int clientToScreenH(int h);
|
||||
virtual int screenToClientX(int x);
|
||||
virtual int screenToClientY(int y);
|
||||
virtual int screenToClientW(int w);
|
||||
virtual int screenToClientH(int h);
|
||||
virtual int getAutoWidth();
|
||||
virtual int getAutoHeight();
|
||||
virtual void setFocus();
|
||||
virtual void onChar(const wchar_t *c);
|
||||
virtual void onAccelerator(const wchar_t *accel);
|
||||
virtual int isMouseOverRect();
|
||||
virtual ScriptObject *getInterface(const wchar_t *interface_guid);
|
||||
virtual void onKeyDown(int vk_code);
|
||||
virtual void onKeyUp(int vk_code);
|
||||
virtual void onGetFocus();
|
||||
virtual void onKillFocus();
|
||||
virtual int sendAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2);
|
||||
virtual int onAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2, ScriptObject *source);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int show_id;
|
||||
static int hide_id;
|
||||
static int isvisible_id;
|
||||
static int onsetvisible_id;
|
||||
static int setalpha_id;
|
||||
static int getalpha_id;
|
||||
static int onleftbuttonup_id;
|
||||
static int onleftbuttondown_id;
|
||||
static int onrightbuttonup_id;
|
||||
static int onrightbuttondown_id;
|
||||
static int onrightbuttondblclk_id;
|
||||
static int onleftbuttondblclk_id;
|
||||
static int onmousemove_id;
|
||||
static int onenterarea_id;
|
||||
static int onleavearea_id;
|
||||
static int setenabled_id;
|
||||
static int getenabled_id;
|
||||
static int onenable_id;
|
||||
static int resize_id;
|
||||
static int onresize_id;
|
||||
static int ismouseover_id;
|
||||
static int getleft_id;
|
||||
static int gettop_id;
|
||||
static int getwidth_id;
|
||||
static int getheight_id;
|
||||
static int settargetx_id;
|
||||
static int settargety_id;
|
||||
static int settargetw_id;
|
||||
static int settargeth_id;
|
||||
static int settargeta_id;
|
||||
static int settargetspeed_id;
|
||||
static int gototarget_id;
|
||||
static int ontargetreached_id;
|
||||
static int canceltarget_id;
|
||||
static int reversetarget_id;
|
||||
static int onstartup_id;
|
||||
static int isgoingtotarget_id;
|
||||
static int setxmlparam_id;
|
||||
static int getxmlparam_id;
|
||||
static int init_id;
|
||||
static int bringtofront_id;
|
||||
static int bringtoback_id;
|
||||
static int bringabove_id;
|
||||
static int bringbelow_id;
|
||||
static int getguix_id;
|
||||
static int getguiy_id;
|
||||
static int getguiw_id;
|
||||
static int getguih_id;
|
||||
static int getguirelatx_id;
|
||||
static int getguirelaty_id;
|
||||
static int getguirelatw_id;
|
||||
static int getguirelath_id;
|
||||
static int isactive_id;
|
||||
static int getparent_id;
|
||||
static int getparentlayout_id;
|
||||
static int gettopparent_id;
|
||||
static int runmodal_id;
|
||||
static int endmodal_id;
|
||||
static int findobject_id;
|
||||
static int findobjectxy_id;
|
||||
static int getname_id;
|
||||
static int clienttoscreenx_id;
|
||||
static int clienttoscreeny_id;
|
||||
static int clienttoscreenw_id;
|
||||
static int clienttoscreenh_id;
|
||||
static int screentoclientx_id;
|
||||
static int screentoclienty_id;
|
||||
static int screentoclientw_id;
|
||||
static int screentoclienth_id;
|
||||
static int getautowidth_id;
|
||||
static int getautoheight_id;
|
||||
static int setfocus_id;
|
||||
static int onchar_id;
|
||||
static int onaccelerator_id;
|
||||
static int ismouseoverrect_id;
|
||||
static int getinterface_id;
|
||||
static int onkeydown_id;
|
||||
static int onkeyup_id;
|
||||
static int ongetfocus_id;
|
||||
static int onkillfocus_id;
|
||||
static int sendaction_id;
|
||||
static int onaction_id;
|
||||
};
|
||||
|
||||
#endif
|
491
Src/Wasabi/api/script/objects/c_script/c_guitree.cpp
Normal file
491
Src/Wasabi/api/script/objects/c_script/c_guitree.cpp
Normal file
|
@ -0,0 +1,491 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_guitree.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_GuiTree::C_GuiTree(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_GuiTree::C_GuiTree() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_GuiTree::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, guiTreeGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
onwantautocontextmenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onWantAutoContextMenu", this);
|
||||
onmousewheelup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseWheelUp", this);
|
||||
onmousewheeldown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseWheelDown", this);
|
||||
oncontextmenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onContextMenu", this);
|
||||
onchar_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onChar", this);
|
||||
onitemrecvdrop_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onItemRecvDrop", this);
|
||||
onlabelchange_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLabelChange", this);
|
||||
onitemselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onItemSelected", this);
|
||||
onitemdeselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onItemDeselected", this);
|
||||
getnumrootitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumRootItems", this);
|
||||
enumrootitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumRootItem", this);
|
||||
jumptonext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"jumpToNext", this);
|
||||
ensureitemvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"ensureItemVisible", this);
|
||||
getcontentswidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getContentsWidth", this);
|
||||
getcontentsheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getContentsHeight", this);
|
||||
addtreeitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"addTreeItem", this);
|
||||
removetreeitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"removeTreeItem", this);
|
||||
movetreeitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"moveTreeItem", this);
|
||||
deleteallitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"deleteAllItems", this);
|
||||
expanditem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"expandItem", this);
|
||||
expanditemdeferred_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"expandItemDeferred", this);
|
||||
collapseitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"collapseItem", this);
|
||||
collapseitemdeferred_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"collapseItemDeferred", this);
|
||||
selectitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectItem", this);
|
||||
selectitemdeferred_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"selectItemDeferred", this);
|
||||
delitemdeferred_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"delItemDeferred", this);
|
||||
hiliteitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hiliteItem", this);
|
||||
unhiliteitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"unhiliteItem", this);
|
||||
getcuritem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getCurItem", this);
|
||||
hittest_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hitTest", this);
|
||||
edititemlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"editItemLabel", this);
|
||||
canceleditlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"cancelEditLabel", this);
|
||||
setautoedit_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAutoEdit", this);
|
||||
getautoedit_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoEdit", this);
|
||||
getbylabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getByLabel", this);
|
||||
setsorted_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSorted", this);
|
||||
getsorted_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSorted", this);
|
||||
sorttreeitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"sortTreeItems", this);
|
||||
getsibling_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSibling", this);
|
||||
setautocollapse_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAutoCollapse", this);
|
||||
setfontsize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setFontSize", this);
|
||||
getfontsize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getFontSize", this);
|
||||
getnumvisiblechilditems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumVisibleChildItems", this);
|
||||
getnumvisibleitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumVisibleItems", this);
|
||||
enumvisibleitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumVisibleItems", this);
|
||||
enumvisiblechilditems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumVisibleChildItems", this);
|
||||
enumallitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumAllItems", this);
|
||||
getitemrectx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemRectX", this);
|
||||
getitemrecty_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemRectY", this);
|
||||
getitemrectw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemRectW", this);
|
||||
getitemrecth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getItemRectH", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_GuiTree::~C_GuiTree() {
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_GUITREE_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
int C_GuiTree::onWantAutoContextMenu() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onwantautocontextmenu_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiTree::onMouseWheelUp(int clicked, int lines) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(clicked);
|
||||
scriptVar b = MAKE_SCRIPT_INT(lines);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmousewheelup_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::onMouseWheelDown(int clicked, int lines) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(clicked);
|
||||
scriptVar b = MAKE_SCRIPT_INT(lines);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmousewheeldown_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::onContextMenu(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncontextmenu_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::onChar(int c) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(c);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onchar_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::onItemRecvDrop(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onitemrecvdrop_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::onLabelChange(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onlabelchange_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::onItemSelected(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onitemselected_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::onItemDeselected(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onitemdeselected_id, params);
|
||||
}
|
||||
|
||||
int C_GuiTree::getNumRootItems() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumrootitems_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::enumRootItem(int which) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(which);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumrootitem_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::jumpToNext(int c) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(c);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), jumptonext_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::ensureItemVisible(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ensureitemvisible_id, params);
|
||||
}
|
||||
|
||||
int C_GuiTree::getContentsWidth() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcontentswidth_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiTree::getContentsHeight() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcontentsheight_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::addTreeItem(ScriptObject *item, ScriptObject *par, int sorted, int haschildtab) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar b = MAKE_SCRIPT_OBJECT(par);
|
||||
scriptVar c = MAKE_SCRIPT_INT(sorted);
|
||||
scriptVar d = MAKE_SCRIPT_INT(haschildtab);
|
||||
scriptVar *params[4] = {&a, &b, &c, &d};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), addtreeitem_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::removeTreeItem(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), removetreeitem_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::moveTreeItem(ScriptObject *item, ScriptObject *newparent) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar b = MAKE_SCRIPT_OBJECT(newparent);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), movetreeitem_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::deleteAllItems() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), deleteallitems_id, NULL);
|
||||
}
|
||||
|
||||
int C_GuiTree::expandItem(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), expanditem_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::expandItemDeferred(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), expanditemdeferred_id, params);
|
||||
}
|
||||
|
||||
int C_GuiTree::collapseItem(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), collapseitem_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::collapseItemDeferred(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), collapseitemdeferred_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::selectItem(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectitem_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::selectItemDeferred(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), selectitemdeferred_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::delItemDeferred(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), delitemdeferred_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::hiliteItem(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), hiliteitem_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::unhiliteItem(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), unhiliteitem_id, params);
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::getCurItem() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcuritem_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::hitTest(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), hittest_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::editItemLabel(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), edititemlabel_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::cancelEditLabel(int destroyit) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(destroyit);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), canceleditlabel_id, params);
|
||||
}
|
||||
|
||||
void C_GuiTree::setAutoEdit(int ae) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(ae);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setautoedit_id, params);
|
||||
}
|
||||
|
||||
int C_GuiTree::getAutoEdit() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautoedit_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::getByLabel(ScriptObject *item, const wchar_t *name)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar b = MAKE_SCRIPT_STRING(name);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getbylabel_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::setSorted(int dosort) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(dosort);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setsorted_id, params);
|
||||
}
|
||||
|
||||
int C_GuiTree::getSorted() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsorted_id, NULL));
|
||||
}
|
||||
|
||||
void C_GuiTree::sortTreeItems() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), sorttreeitems_id, NULL);
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::getSibling(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsibling_id, params));
|
||||
}
|
||||
|
||||
void C_GuiTree::setAutoCollapse(int doautocollapse) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(doautocollapse);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setautocollapse_id, params);
|
||||
}
|
||||
|
||||
int C_GuiTree::setFontSize(int newsize) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(newsize);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), setfontsize_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::getFontSize() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getfontsize_id, NULL));
|
||||
}
|
||||
|
||||
int C_GuiTree::getNumVisibleChildItems(ScriptObject *c) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(c);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumvisiblechilditems_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::getNumVisibleItems() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumvisibleitems_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::enumVisibleItems(int n) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(n);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumvisibleitems_id, params));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::enumVisibleChildItems(ScriptObject *c, int n) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(c);
|
||||
scriptVar b = MAKE_SCRIPT_INT(n);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumvisiblechilditems_id, params));
|
||||
}
|
||||
|
||||
ScriptObject *C_GuiTree::enumAllItems(int n) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(n);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumallitems_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::getItemRectX(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemrectx_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::getItemRectY(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemrecty_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::getItemRectW(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemrectw_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::getItemRectH(ScriptObject *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getitemrecth_id, params));
|
||||
}
|
||||
|
||||
int C_GuiTree::loaded=0;
|
||||
int C_GuiTree::onwantautocontextmenu_id=0;
|
||||
int C_GuiTree::onmousewheelup_id=0;
|
||||
int C_GuiTree::onmousewheeldown_id=0;
|
||||
int C_GuiTree::oncontextmenu_id=0;
|
||||
int C_GuiTree::onchar_id=0;
|
||||
int C_GuiTree::onitemrecvdrop_id=0;
|
||||
int C_GuiTree::onlabelchange_id=0;
|
||||
int C_GuiTree::onitemselected_id=0;
|
||||
int C_GuiTree::onitemdeselected_id=0;
|
||||
int C_GuiTree::getnumrootitems_id=0;
|
||||
int C_GuiTree::enumrootitem_id=0;
|
||||
int C_GuiTree::jumptonext_id=0;
|
||||
int C_GuiTree::ensureitemvisible_id=0;
|
||||
int C_GuiTree::getcontentswidth_id=0;
|
||||
int C_GuiTree::getcontentsheight_id=0;
|
||||
int C_GuiTree::addtreeitem_id=0;
|
||||
int C_GuiTree::removetreeitem_id=0;
|
||||
int C_GuiTree::movetreeitem_id=0;
|
||||
int C_GuiTree::deleteallitems_id=0;
|
||||
int C_GuiTree::expanditem_id=0;
|
||||
int C_GuiTree::expanditemdeferred_id=0;
|
||||
int C_GuiTree::collapseitem_id=0;
|
||||
int C_GuiTree::collapseitemdeferred_id=0;
|
||||
int C_GuiTree::selectitem_id=0;
|
||||
int C_GuiTree::selectitemdeferred_id=0;
|
||||
int C_GuiTree::delitemdeferred_id=0;
|
||||
int C_GuiTree::hiliteitem_id=0;
|
||||
int C_GuiTree::unhiliteitem_id=0;
|
||||
int C_GuiTree::getcuritem_id=0;
|
||||
int C_GuiTree::hittest_id=0;
|
||||
int C_GuiTree::edititemlabel_id=0;
|
||||
int C_GuiTree::canceleditlabel_id=0;
|
||||
int C_GuiTree::setautoedit_id=0;
|
||||
int C_GuiTree::getautoedit_id=0;
|
||||
int C_GuiTree::getbylabel_id=0;
|
||||
int C_GuiTree::setsorted_id=0;
|
||||
int C_GuiTree::getsorted_id=0;
|
||||
int C_GuiTree::sorttreeitems_id=0;
|
||||
int C_GuiTree::getsibling_id=0;
|
||||
int C_GuiTree::setautocollapse_id=0;
|
||||
int C_GuiTree::setfontsize_id=0;
|
||||
int C_GuiTree::getfontsize_id=0;
|
||||
int C_GuiTree::getnumvisiblechilditems_id=0;
|
||||
int C_GuiTree::getnumvisibleitems_id=0;
|
||||
int C_GuiTree::enumvisibleitems_id=0;
|
||||
int C_GuiTree::enumvisiblechilditems_id=0;
|
||||
int C_GuiTree::enumallitems_id=0;
|
||||
int C_GuiTree::getitemrectx_id=0;
|
||||
int C_GuiTree::getitemrecty_id=0;
|
||||
int C_GuiTree::getitemrectw_id=0;
|
||||
int C_GuiTree::getitemrecth_id=0;
|
131
Src/Wasabi/api/script/objects/c_script/c_guitree.h
Normal file
131
Src/Wasabi/api/script/objects/c_script/c_guitree.h
Normal file
|
@ -0,0 +1,131 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_GUITREE_H
|
||||
#define __C_GUITREE_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_GUITREE_PARENT C_GuiObject
|
||||
|
||||
class C_GuiTree : public C_GUITREE_PARENT {
|
||||
public:
|
||||
|
||||
C_GuiTree(ScriptObject *object);
|
||||
C_GuiTree();
|
||||
virtual ~C_GuiTree();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual int onWantAutoContextMenu();
|
||||
virtual int onMouseWheelUp(int clicked, int lines);
|
||||
virtual int onMouseWheelDown(int clicked, int lines);
|
||||
virtual int onContextMenu(int x, int y);
|
||||
virtual int onChar(int c);
|
||||
virtual void onItemRecvDrop(ScriptObject *item);
|
||||
virtual void onLabelChange(ScriptObject *item);
|
||||
virtual void onItemSelected(ScriptObject *item);
|
||||
virtual void onItemDeselected(ScriptObject *item);
|
||||
virtual int getNumRootItems();
|
||||
virtual ScriptObject *enumRootItem(int which);
|
||||
virtual void jumpToNext(int c);
|
||||
virtual void ensureItemVisible(ScriptObject *item);
|
||||
virtual int getContentsWidth();
|
||||
virtual int getContentsHeight();
|
||||
virtual ScriptObject *addTreeItem(ScriptObject *item, ScriptObject *par, int sorted, int haschildtab);
|
||||
virtual int removeTreeItem(ScriptObject *item);
|
||||
virtual void moveTreeItem(ScriptObject *item, ScriptObject *newparent);
|
||||
virtual void deleteAllItems();
|
||||
virtual int expandItem(ScriptObject *item);
|
||||
virtual void expandItemDeferred(ScriptObject *item);
|
||||
virtual int collapseItem(ScriptObject *item);
|
||||
virtual void collapseItemDeferred(ScriptObject *item);
|
||||
virtual void selectItem(ScriptObject *item);
|
||||
virtual void selectItemDeferred(ScriptObject *item);
|
||||
virtual void delItemDeferred(ScriptObject *item);
|
||||
virtual void hiliteItem(ScriptObject *item);
|
||||
virtual void unhiliteItem(ScriptObject *item);
|
||||
virtual ScriptObject *getCurItem();
|
||||
virtual ScriptObject *hitTest(int x, int y);
|
||||
virtual void editItemLabel(ScriptObject *item);
|
||||
virtual void cancelEditLabel(int destroyit);
|
||||
virtual void setAutoEdit(int ae);
|
||||
virtual int getAutoEdit();
|
||||
virtual ScriptObject *getByLabel(ScriptObject *item, const wchar_t *name);
|
||||
virtual void setSorted(int dosort);
|
||||
virtual int getSorted();
|
||||
virtual void sortTreeItems();
|
||||
virtual ScriptObject *getSibling(ScriptObject *item);
|
||||
virtual void setAutoCollapse(int doautocollapse);
|
||||
virtual int setFontSize(int newsize);
|
||||
virtual int getFontSize();
|
||||
virtual int getNumVisibleChildItems(ScriptObject *c);
|
||||
virtual int getNumVisibleItems();
|
||||
virtual ScriptObject *enumVisibleItems(int n);
|
||||
virtual ScriptObject *enumVisibleChildItems(ScriptObject *c, int n);
|
||||
virtual ScriptObject *enumAllItems(int n);
|
||||
virtual int getItemRectX(ScriptObject *item);
|
||||
virtual int getItemRectY(ScriptObject *item);
|
||||
virtual int getItemRectW(ScriptObject *item);
|
||||
virtual int getItemRectH(ScriptObject *item);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onwantautocontextmenu_id;
|
||||
static int onmousewheelup_id;
|
||||
static int onmousewheeldown_id;
|
||||
static int oncontextmenu_id;
|
||||
static int onchar_id;
|
||||
static int onitemrecvdrop_id;
|
||||
static int onlabelchange_id;
|
||||
static int onitemselected_id;
|
||||
static int onitemdeselected_id;
|
||||
static int getnumrootitems_id;
|
||||
static int enumrootitem_id;
|
||||
static int jumptonext_id;
|
||||
static int ensureitemvisible_id;
|
||||
static int getcontentswidth_id;
|
||||
static int getcontentsheight_id;
|
||||
static int addtreeitem_id;
|
||||
static int removetreeitem_id;
|
||||
static int movetreeitem_id;
|
||||
static int deleteallitems_id;
|
||||
static int expanditem_id;
|
||||
static int expanditemdeferred_id;
|
||||
static int collapseitem_id;
|
||||
static int collapseitemdeferred_id;
|
||||
static int selectitem_id;
|
||||
static int selectitemdeferred_id;
|
||||
static int delitemdeferred_id;
|
||||
static int hiliteitem_id;
|
||||
static int unhiliteitem_id;
|
||||
static int getcuritem_id;
|
||||
static int hittest_id;
|
||||
static int edititemlabel_id;
|
||||
static int canceleditlabel_id;
|
||||
static int setautoedit_id;
|
||||
static int getautoedit_id;
|
||||
static int getbylabel_id;
|
||||
static int setsorted_id;
|
||||
static int getsorted_id;
|
||||
static int sorttreeitems_id;
|
||||
static int getsibling_id;
|
||||
static int setautocollapse_id;
|
||||
static int setfontsize_id;
|
||||
static int getfontsize_id;
|
||||
static int getnumvisiblechilditems_id;
|
||||
static int getnumvisibleitems_id;
|
||||
static int enumvisibleitems_id;
|
||||
static int enumvisiblechilditems_id;
|
||||
static int enumallitems_id;
|
||||
static int getitemrectx_id;
|
||||
static int getitemrecty_id;
|
||||
static int getitemrectw_id;
|
||||
static int getitemrecth_id;
|
||||
};
|
||||
|
||||
#endif
|
236
Src/Wasabi/api/script/objects/c_script/c_layout.cpp
Normal file
236
Src/Wasabi/api/script/objects/c_script/c_layout.cpp
Normal file
|
@ -0,0 +1,236 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_layout.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Layout::C_Layout(ScriptObject *object) : C_Group(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Layout::C_Layout() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Layout::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, layoutGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
ondock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDock", this);
|
||||
onundock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onUndock", this);
|
||||
onscale_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onScale", this);
|
||||
getscale_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getScale", this);
|
||||
setscale_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setScale", this);
|
||||
setdesktopalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setDesktopAlpha", this);
|
||||
getdesktopalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getDesktopAlpha", this);
|
||||
getcontainer_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getContainer", this);
|
||||
center_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"center", this);
|
||||
onmove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMove", this);
|
||||
onendmove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEndMove", this);
|
||||
onuserresize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onUserResize", this);
|
||||
snapadjust_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"snapAdjust", this);
|
||||
getsnapadjusttop_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustTop", this);
|
||||
getsnapadjustright_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustRight", this);
|
||||
getsnapadjustleft_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustLeft", this);
|
||||
getsnapadjustbottom_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustBottom", this);
|
||||
setredrawonresize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setRedrawOnResize", this);
|
||||
beforeredock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"beforeRedock", this);
|
||||
redock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"redock", this);
|
||||
istransparencysafe_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isTransparencySafe", this);
|
||||
islayoutanimationsafe_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isLayoutAnimationSafe", this);
|
||||
onmouseenterlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseEnterLayout", this);
|
||||
onmouseleavelayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseLeaveLayout", this);
|
||||
onsnapadjustchanged_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSnapAdjustChanged", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Layout::~C_Layout() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Layout::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_LAYOUT_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Layout::onDock() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondock_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onUndock() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onundock_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onScale(double newscalevalue) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_DOUBLE(newscalevalue);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onscale_id, params);
|
||||
}
|
||||
|
||||
double C_Layout::getScale() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_DOUBLE(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getscale_id, NULL));
|
||||
}
|
||||
|
||||
void C_Layout::setScale(double scalevalue) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_DOUBLE(scalevalue);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setscale_id, params);
|
||||
}
|
||||
|
||||
void C_Layout::setDesktopAlpha(int onoff) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(onoff);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setdesktopalpha_id, params);
|
||||
}
|
||||
|
||||
int C_Layout::getDesktopAlpha() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getdesktopalpha_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_Layout::getContainer() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcontainer_id, NULL));
|
||||
}
|
||||
|
||||
void C_Layout::center() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), center_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onMove() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmove_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onEndMove() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onendmove_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onUserResize(int x, int y, int w, int h) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar c = MAKE_SCRIPT_INT(w);
|
||||
scriptVar d = MAKE_SCRIPT_INT(h);
|
||||
scriptVar *params[4] = {&a, &b, &c, &d};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onuserresize_id, params);
|
||||
}
|
||||
|
||||
void C_Layout::snapAdjust(int left, int top, int right, int bottom) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(left);
|
||||
scriptVar b = MAKE_SCRIPT_INT(top);
|
||||
scriptVar c = MAKE_SCRIPT_INT(right);
|
||||
scriptVar d = MAKE_SCRIPT_INT(bottom);
|
||||
scriptVar *params[4] = {&a, &b, &c, &d};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), snapadjust_id, params);
|
||||
}
|
||||
|
||||
int C_Layout::getSnapAdjustTop() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjusttop_id, NULL));
|
||||
}
|
||||
|
||||
int C_Layout::getSnapAdjustRight() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjustright_id, NULL));
|
||||
}
|
||||
|
||||
int C_Layout::getSnapAdjustLeft() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjustleft_id, NULL));
|
||||
}
|
||||
|
||||
int C_Layout::getSnapAdjustBottom() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjustbottom_id, NULL));
|
||||
}
|
||||
|
||||
void C_Layout::setRedrawOnResize(int wantredrawonresize) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(wantredrawonresize);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setredrawonresize_id, params);
|
||||
}
|
||||
|
||||
void C_Layout::beforeRedock() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), beforeredock_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::redock() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), redock_id, NULL);
|
||||
}
|
||||
|
||||
int C_Layout::isTransparencySafe() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), istransparencysafe_id, NULL));
|
||||
}
|
||||
|
||||
int C_Layout::isLayoutAnimationSafe() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), islayoutanimationsafe_id, NULL));
|
||||
}
|
||||
|
||||
void C_Layout::onMouseEnterLayout() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmouseenterlayout_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onMouseLeaveLayout() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmouseleavelayout_id, NULL);
|
||||
}
|
||||
|
||||
void C_Layout::onSnapAdjustChanged() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsnapadjustchanged_id, NULL);
|
||||
}
|
||||
|
||||
int C_Layout::loaded=0;
|
||||
int C_Layout::ondock_id=0;
|
||||
int C_Layout::onundock_id=0;
|
||||
int C_Layout::onscale_id=0;
|
||||
int C_Layout::getscale_id=0;
|
||||
int C_Layout::setscale_id=0;
|
||||
int C_Layout::setdesktopalpha_id=0;
|
||||
int C_Layout::getdesktopalpha_id=0;
|
||||
int C_Layout::getcontainer_id=0;
|
||||
int C_Layout::center_id=0;
|
||||
int C_Layout::onmove_id=0;
|
||||
int C_Layout::onendmove_id=0;
|
||||
int C_Layout::onuserresize_id=0;
|
||||
int C_Layout::snapadjust_id=0;
|
||||
int C_Layout::getsnapadjusttop_id=0;
|
||||
int C_Layout::getsnapadjustright_id=0;
|
||||
int C_Layout::getsnapadjustleft_id=0;
|
||||
int C_Layout::getsnapadjustbottom_id=0;
|
||||
int C_Layout::setredrawonresize_id=0;
|
||||
int C_Layout::beforeredock_id=0;
|
||||
int C_Layout::redock_id=0;
|
||||
int C_Layout::istransparencysafe_id=0;
|
||||
int C_Layout::islayoutanimationsafe_id=0;
|
||||
int C_Layout::onmouseenterlayout_id=0;
|
||||
int C_Layout::onmouseleavelayout_id=0;
|
||||
int C_Layout::onsnapadjustchanged_id=0;
|
79
Src/Wasabi/api/script/objects/c_script/c_layout.h
Normal file
79
Src/Wasabi/api/script/objects/c_script/c_layout.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_LAYOUT_H
|
||||
#define __C_LAYOUT_H
|
||||
|
||||
#include "c_group.h"
|
||||
|
||||
#define C_LAYOUT_PARENT C_Group
|
||||
|
||||
class C_Layout : public C_LAYOUT_PARENT {
|
||||
public:
|
||||
|
||||
C_Layout(ScriptObject *object);
|
||||
C_Layout();
|
||||
virtual ~C_Layout();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onDock();
|
||||
virtual void onUndock();
|
||||
virtual void onScale(double newscalevalue);
|
||||
virtual double getScale();
|
||||
virtual void setScale(double scalevalue);
|
||||
virtual void setDesktopAlpha(int onoff);
|
||||
virtual int getDesktopAlpha();
|
||||
virtual ScriptObject *getContainer();
|
||||
virtual void center();
|
||||
virtual void onMove();
|
||||
virtual void onEndMove();
|
||||
virtual void onUserResize(int x, int y, int w, int h);
|
||||
virtual void snapAdjust(int left, int top, int right, int bottom);
|
||||
virtual int getSnapAdjustTop();
|
||||
virtual int getSnapAdjustRight();
|
||||
virtual int getSnapAdjustLeft();
|
||||
virtual int getSnapAdjustBottom();
|
||||
virtual void setRedrawOnResize(int wantredrawonresize);
|
||||
virtual void beforeRedock();
|
||||
virtual void redock();
|
||||
virtual int isTransparencySafe();
|
||||
virtual int isLayoutAnimationSafe();
|
||||
virtual void onMouseEnterLayout();
|
||||
virtual void onMouseLeaveLayout();
|
||||
virtual void onSnapAdjustChanged();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int ondock_id;
|
||||
static int onundock_id;
|
||||
static int onscale_id;
|
||||
static int getscale_id;
|
||||
static int setscale_id;
|
||||
static int setdesktopalpha_id;
|
||||
static int getdesktopalpha_id;
|
||||
static int getcontainer_id;
|
||||
static int center_id;
|
||||
static int onmove_id;
|
||||
static int onendmove_id;
|
||||
static int onuserresize_id;
|
||||
static int snapadjust_id;
|
||||
static int getsnapadjusttop_id;
|
||||
static int getsnapadjustright_id;
|
||||
static int getsnapadjustleft_id;
|
||||
static int getsnapadjustbottom_id;
|
||||
static int setredrawonresize_id;
|
||||
static int beforeredock_id;
|
||||
static int redock_id;
|
||||
static int istransparencysafe_id;
|
||||
static int islayoutanimationsafe_id;
|
||||
static int onmouseenterlayout_id;
|
||||
static int onmouseleavelayout_id;
|
||||
static int onsnapadjustchanged_id;
|
||||
};
|
||||
|
||||
#endif
|
80
Src/Wasabi/api/script/objects/c_script/c_menubutton.cpp
Normal file
80
Src/Wasabi/api/script/objects/c_script/c_menubutton.cpp
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_menubutton.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_MenuButton::C_MenuButton(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_MenuButton::C_MenuButton() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_MenuButton::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, menuButtonGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
onopenmenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onOpenMenu", this);
|
||||
onclosemenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onCloseMenu", this);
|
||||
onselectitem_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSelectItem", this);
|
||||
openmenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"openMenu", this);
|
||||
closemenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"closeMenu", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_MenuButton::~C_MenuButton() {
|
||||
}
|
||||
|
||||
ScriptObject *C_MenuButton::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_MENUBUTTON_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_MenuButton::onOpenMenu() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onopenmenu_id, NULL);
|
||||
}
|
||||
|
||||
void C_MenuButton::onCloseMenu() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onclosemenu_id, NULL);
|
||||
}
|
||||
|
||||
void C_MenuButton::onSelectItem(const wchar_t *item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(item);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onselectitem_id, params);
|
||||
}
|
||||
|
||||
void C_MenuButton::openMenu() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), openmenu_id, NULL);
|
||||
}
|
||||
|
||||
void C_MenuButton::closeMenu() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), closemenu_id, NULL);
|
||||
}
|
||||
|
||||
int C_MenuButton::loaded=0;
|
||||
int C_MenuButton::onopenmenu_id=0;
|
||||
int C_MenuButton::onclosemenu_id=0;
|
||||
int C_MenuButton::onselectitem_id=0;
|
||||
int C_MenuButton::openmenu_id=0;
|
||||
int C_MenuButton::closemenu_id=0;
|
39
Src/Wasabi/api/script/objects/c_script/c_menubutton.h
Normal file
39
Src/Wasabi/api/script/objects/c_script/c_menubutton.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_MENUBUTTON_H
|
||||
#define __C_MENUBUTTON_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_MENUBUTTON_PARENT C_GuiObject
|
||||
|
||||
class C_MenuButton : public C_MENUBUTTON_PARENT {
|
||||
public:
|
||||
|
||||
C_MenuButton(ScriptObject *object);
|
||||
C_MenuButton();
|
||||
virtual ~C_MenuButton();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onOpenMenu();
|
||||
virtual void onCloseMenu();
|
||||
virtual void onSelectItem(const wchar_t *item);
|
||||
virtual void openMenu();
|
||||
virtual void closeMenu();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onopenmenu_id;
|
||||
static int onclosemenu_id;
|
||||
static int onselectitem_id;
|
||||
static int openmenu_id;
|
||||
static int closemenu_id;
|
||||
};
|
||||
|
||||
#endif
|
49
Src/Wasabi/api/script/objects/c_script/c_querylist.cpp
Normal file
49
Src/Wasabi/api/script/objects/c_script/c_querylist.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_querylist.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_QueryList::C_QueryList(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_QueryList::C_QueryList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_QueryList::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, queryListGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
if (!loaded) {
|
||||
loaded = 1;
|
||||
onresetquery_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onResetQuery", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_QueryList::~C_QueryList() {
|
||||
}
|
||||
|
||||
ScriptObject *C_QueryList::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_QUERYLIST_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_QueryList::onResetQuery() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onresetquery_id, NULL);
|
||||
}
|
||||
|
||||
int C_QueryList::loaded=0;
|
||||
int C_QueryList::onresetquery_id=0;
|
31
Src/Wasabi/api/script/objects/c_script/c_querylist.h
Normal file
31
Src/Wasabi/api/script/objects/c_script/c_querylist.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_QUERYLIST_H
|
||||
#define __C_QUERYLIST_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_QUERYLIST_PARENT C_GuiObject
|
||||
|
||||
class C_QueryList : public C_QUERYLIST_PARENT {
|
||||
public:
|
||||
|
||||
C_QueryList(ScriptObject *object);
|
||||
C_QueryList();
|
||||
virtual ~C_QueryList();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onResetQuery();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onresetquery_id;
|
||||
};
|
||||
|
||||
#endif
|
64
Src/Wasabi/api/script/objects/c_script/c_rootobj.cpp
Normal file
64
Src/Wasabi/api/script/objects/c_script/c_rootobj.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
#include <precomp.h>
|
||||
|
||||
#include <api/script/scriptobj.h>
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "c_rootobj.h"
|
||||
|
||||
C_RootObject::C_RootObject(ScriptObject *o)
|
||||
{
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(o);
|
||||
}
|
||||
|
||||
C_RootObject::C_RootObject()
|
||||
{
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_RootObject::C_hook(ScriptObject *o)
|
||||
{
|
||||
ASSERT(!inited);
|
||||
obj = o;
|
||||
if (count++ == 0) {
|
||||
getclassname_id = WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"getClassName", this);
|
||||
notify_id = WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"notify", this);
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
C_RootObject::~C_RootObject()
|
||||
{
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
//count--;
|
||||
}
|
||||
|
||||
ScriptObject *C_RootObject::getScriptObject()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return obj;
|
||||
}
|
||||
|
||||
const wchar_t *C_RootObject::getClassName()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(obj, getclassname_id, NULL));
|
||||
}
|
||||
|
||||
void C_RootObject::notify(const wchar_t *a, const wchar_t *b, int c, int d)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar _a = MAKE_SCRIPT_STRING(a);
|
||||
scriptVar _b = MAKE_SCRIPT_STRING(b);
|
||||
scriptVar _c = MAKE_SCRIPT_INT(c);
|
||||
scriptVar _d = MAKE_SCRIPT_INT(d);
|
||||
scriptVar *params[4]={&_a, &_b, &_c, &_d};
|
||||
WASABI_API_MAKI->maki_callFunction(obj, notify_id, params);
|
||||
}
|
||||
|
||||
int C_RootObject::getclassname_id=0;
|
||||
int C_RootObject::notify_id=0;
|
||||
int C_RootObject::inited=0;
|
||||
int C_RootObject::count=0;
|
33
Src/Wasabi/api/script/objects/c_script/c_rootobj.h
Normal file
33
Src/Wasabi/api/script/objects/c_script/c_rootobj.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef __C_SCRIPTOBJ_H
|
||||
#define __C_SCRIPTOBJ_H
|
||||
|
||||
#include <api/script/scriptobj.h>
|
||||
|
||||
class C_RootObject{
|
||||
|
||||
public:
|
||||
|
||||
C_RootObject(ScriptObject *o);
|
||||
C_RootObject();
|
||||
virtual ~C_RootObject();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
virtual const wchar_t *getClassName();
|
||||
virtual void notify(const wchar_t *a, const wchar_t *b, int c, int d);
|
||||
virtual ScriptObject *getScriptObject();
|
||||
|
||||
operator ScriptObject *() { return getScriptObject(); }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
static int getclassname_id;
|
||||
static int notify_id;
|
||||
static int inited;
|
||||
static int count;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
100
Src/Wasabi/api/script/objects/c_script/c_slider.cpp
Normal file
100
Src/Wasabi/api/script/objects/c_script/c_slider.cpp
Normal file
|
@ -0,0 +1,100 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_slider.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Slider::C_Slider(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Slider::C_Slider() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Slider::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, sliderGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
onsetposition_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSetPosition", this);
|
||||
onpostedposition_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onPostedPosition", this);
|
||||
onsetfinalposition_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSetFinalPosition", this);
|
||||
setposition_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setPosition", this);
|
||||
getposition_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getPosition", this);
|
||||
lock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"lock", this);
|
||||
unlock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"unlock", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Slider::~C_Slider() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Slider::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_SLIDER_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Slider::onSetPosition(int newpos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(newpos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsetposition_id, params);
|
||||
}
|
||||
|
||||
void C_Slider::onPostedPosition(int newpos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(newpos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onpostedposition_id, params);
|
||||
}
|
||||
|
||||
void C_Slider::onSetFinalPosition(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsetfinalposition_id, params);
|
||||
}
|
||||
|
||||
void C_Slider::setPosition(int pos) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(pos);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setposition_id, params);
|
||||
}
|
||||
|
||||
int C_Slider::getPosition() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getposition_id, NULL));
|
||||
}
|
||||
|
||||
void C_Slider::lock() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), lock_id, NULL);
|
||||
}
|
||||
|
||||
void C_Slider::unlock() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), unlock_id, NULL);
|
||||
}
|
||||
|
||||
int C_Slider::loaded=0;
|
||||
int C_Slider::onsetposition_id=0;
|
||||
int C_Slider::onpostedposition_id=0;
|
||||
int C_Slider::onsetfinalposition_id=0;
|
||||
int C_Slider::setposition_id=0;
|
||||
int C_Slider::getposition_id=0;
|
||||
int C_Slider::lock_id=0;
|
||||
int C_Slider::unlock_id=0;
|
43
Src/Wasabi/api/script/objects/c_script/c_slider.h
Normal file
43
Src/Wasabi/api/script/objects/c_script/c_slider.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_SLIDER_H
|
||||
#define __C_SLIDER_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_SLIDER_PARENT C_GuiObject
|
||||
|
||||
class C_Slider : public C_SLIDER_PARENT {
|
||||
public:
|
||||
|
||||
C_Slider(ScriptObject *object);
|
||||
C_Slider();
|
||||
virtual ~C_Slider();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onSetPosition(int newpos);
|
||||
virtual void onPostedPosition(int newpos);
|
||||
virtual void onSetFinalPosition(int pos);
|
||||
virtual void setPosition(int pos);
|
||||
virtual int getPosition();
|
||||
virtual void lock();
|
||||
virtual void unlock();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onsetposition_id;
|
||||
static int onpostedposition_id;
|
||||
static int onsetfinalposition_id;
|
||||
static int setposition_id;
|
||||
static int getposition_id;
|
||||
static int lock_id;
|
||||
static int unlock_id;
|
||||
};
|
||||
|
||||
#endif
|
59
Src/Wasabi/api/script/objects/c_script/c_tabsheet.cpp
Normal file
59
Src/Wasabi/api/script/objects/c_script/c_tabsheet.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
#include <api/api.h>
|
||||
#include "c_tabsheet.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_TabSheet::C_TabSheet(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_TabSheet::C_TabSheet() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_TabSheet::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, tabSheetGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
getcurpage_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getCurPage", this);
|
||||
setcurpage_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setCurPage", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_TabSheet::~C_TabSheet() {
|
||||
}
|
||||
|
||||
ScriptObject *C_TabSheet::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_TABSHEET_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
int C_TabSheet::getCurPage() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcurpage_id, NULL));
|
||||
}
|
||||
|
||||
void C_TabSheet::setCurPage(int a) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(a);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setcurpage_id, params);
|
||||
}
|
||||
|
||||
int C_TabSheet::loaded=0;
|
||||
int C_TabSheet::getcurpage_id=0;
|
||||
int C_TabSheet::setcurpage_id=0;
|
33
Src/Wasabi/api/script/objects/c_script/c_tabsheet.h
Normal file
33
Src/Wasabi/api/script/objects/c_script/c_tabsheet.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_TABSHEET_H
|
||||
#define __C_TABSHEET_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_TABSHEET_PARENT C_GuiObject
|
||||
|
||||
class C_TabSheet : public C_TABSHEET_PARENT {
|
||||
public:
|
||||
|
||||
C_TabSheet(ScriptObject *object);
|
||||
C_TabSheet();
|
||||
virtual ~C_TabSheet();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual int getCurPage();
|
||||
virtual void setCurPage(int a);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int getcurpage_id;
|
||||
static int setcurpage_id;
|
||||
};
|
||||
|
||||
#endif
|
89
Src/Wasabi/api/script/objects/c_script/c_text.cpp
Normal file
89
Src/Wasabi/api/script/objects/c_script/c_text.cpp
Normal file
|
@ -0,0 +1,89 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_text.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_Text::C_Text(ScriptObject *object) : C_GuiObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_Text::C_Text() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_Text::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, textGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
settext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setText", this);
|
||||
setalternatetext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAlternateText", this);
|
||||
gettext_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getText", this);
|
||||
gettextwidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTextWidth", this);
|
||||
ontextchanged_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTextChanged", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_Text::~C_Text() {
|
||||
}
|
||||
|
||||
ScriptObject *C_Text::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_TEXT_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_Text::setText(const wchar_t *txt)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(txt);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), settext_id, params);
|
||||
}
|
||||
|
||||
void C_Text::setAlternateText(const wchar_t *txt)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(txt);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setalternatetext_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_Text::getText()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettext_id, NULL));
|
||||
}
|
||||
|
||||
int C_Text::getTextWidth()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettextwidth_id, NULL));
|
||||
}
|
||||
|
||||
void C_Text::onTextChanged(const wchar_t *newtxt)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(newtxt);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontextchanged_id, params);
|
||||
}
|
||||
|
||||
int C_Text::loaded=0;
|
||||
int C_Text::settext_id=0;
|
||||
int C_Text::setalternatetext_id=0;
|
||||
int C_Text::gettext_id=0;
|
||||
int C_Text::gettextwidth_id=0;
|
||||
int C_Text::ontextchanged_id=0;
|
40
Src/Wasabi/api/script/objects/c_script/c_text.h
Normal file
40
Src/Wasabi/api/script/objects/c_script/c_text.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_TEXT_H
|
||||
#define __C_TEXT_H
|
||||
|
||||
#include "c_guiobject.h"
|
||||
|
||||
#define C_TEXT_PARENT C_GuiObject
|
||||
|
||||
class C_Text : public C_TEXT_PARENT
|
||||
{
|
||||
public:
|
||||
|
||||
C_Text(ScriptObject *object);
|
||||
C_Text();
|
||||
virtual ~C_Text();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void setText(const wchar_t *txt);
|
||||
virtual void setAlternateText(const wchar_t *txt);
|
||||
virtual const wchar_t *getText();
|
||||
virtual int getTextWidth();
|
||||
virtual void onTextChanged(const wchar_t *newtxt);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int settext_id;
|
||||
static int setalternatetext_id;
|
||||
static int gettext_id;
|
||||
static int gettextwidth_id;
|
||||
static int ontextchanged_id;
|
||||
};
|
||||
|
||||
#endif
|
59
Src/Wasabi/api/script/objects/c_script/c_togglebutton.cpp
Normal file
59
Src/Wasabi/api/script/objects/c_script/c_togglebutton.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_togglebutton.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_ToggleButton::C_ToggleButton(ScriptObject *object) : C_Button(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_ToggleButton::C_ToggleButton() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_ToggleButton::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, toggleButtonGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
ontoggle_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onToggle", this);
|
||||
getcurcfgval_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getCurCfgVal", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_ToggleButton::~C_ToggleButton() {
|
||||
}
|
||||
|
||||
ScriptObject *C_ToggleButton::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_TOGGLEBUTTON_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
void C_ToggleButton::onToggle(int (null)) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT((null));
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontoggle_id, params);
|
||||
}
|
||||
|
||||
int C_ToggleButton::getCurCfgVal() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcurcfgval_id, NULL));
|
||||
}
|
||||
|
||||
int C_ToggleButton::loaded=0;
|
||||
int C_ToggleButton::ontoggle_id=0;
|
||||
int C_ToggleButton::getcurcfgval_id=0;
|
33
Src/Wasabi/api/script/objects/c_script/c_togglebutton.h
Normal file
33
Src/Wasabi/api/script/objects/c_script/c_togglebutton.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_TOGGLEBUTTON_H
|
||||
#define __C_TOGGLEBUTTON_H
|
||||
|
||||
#include "c_button.h"
|
||||
|
||||
#define C_TOGGLEBUTTON_PARENT C_Button
|
||||
|
||||
class C_ToggleButton : public C_TOGGLEBUTTON_PARENT {
|
||||
public:
|
||||
|
||||
C_ToggleButton(ScriptObject *object);
|
||||
C_ToggleButton();
|
||||
virtual ~C_ToggleButton();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual void onToggle(int (null));
|
||||
virtual int getCurCfgVal();
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int ontoggle_id;
|
||||
static int getcurcfgval_id;
|
||||
};
|
||||
|
||||
#endif
|
310
Src/Wasabi/api/script/objects/c_script/c_treeitem.cpp
Normal file
310
Src/Wasabi/api/script/objects/c_script/c_treeitem.cpp
Normal file
|
@ -0,0 +1,310 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include "c_treeitem.h"
|
||||
#include <api/script/objcontroller.h>
|
||||
|
||||
C_TreeItem::C_TreeItem(ScriptObject *object) : C_RootObject(object) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
C_hook(object);
|
||||
}
|
||||
|
||||
C_TreeItem::C_TreeItem() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void C_TreeItem::C_hook(ScriptObject *object) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = object->vcpu_getController();
|
||||
obj = controller->cast(object, treeItemGuid);
|
||||
if (obj != object && obj != NULL)
|
||||
controller = obj->vcpu_getController();
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = iter;
|
||||
getnumchildren_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumChildren", this);
|
||||
setlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setLabel", this);
|
||||
getlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLabel", this);
|
||||
ensurevisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"ensureVisible", this);
|
||||
getnthchild_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNthChild", this);
|
||||
getchild_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getChild", this);
|
||||
getchildsibling_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getChildSibling", this);
|
||||
getsibling_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSibling", this);
|
||||
getparent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getParent", this);
|
||||
editlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"editLabel", this);
|
||||
hassubitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hasSubItems", this);
|
||||
setsorted_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSorted", this);
|
||||
setchildtab_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setChildTab", this);
|
||||
issorted_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isSorted", this);
|
||||
iscollapsed_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isCollapsed", this);
|
||||
isexpanded_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isExpanded", this);
|
||||
invalidate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"invalidate", this);
|
||||
isselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isSelected", this);
|
||||
ishilited_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isHilited", this);
|
||||
sethilited_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setHilited", this);
|
||||
collapse_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"collapse", this);
|
||||
expand_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"expand", this);
|
||||
gettree_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTree", this);
|
||||
ontreeadd_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTreeAdd", this);
|
||||
ontreeremove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTreeRemove", this);
|
||||
onselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSelect", this);
|
||||
ondeselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDeselect", this);
|
||||
onleftdoubleclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftDoubleClick", this);
|
||||
onrightdoubleclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightDoubleClick", this);
|
||||
onchar_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onChar", this);
|
||||
onexpand_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onExpand", this);
|
||||
oncollapse_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onCollapse", this);
|
||||
onbeginlabeledit_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onBeginLabelEdit", this);
|
||||
onendlabeledit_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEndLabelEdit", this);
|
||||
oncontextmenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onContextMenu", this);
|
||||
}
|
||||
inited = 1;
|
||||
}
|
||||
|
||||
C_TreeItem::~C_TreeItem() {
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getScriptObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return C_TREEITEM_PARENT::getScriptObject();
|
||||
}
|
||||
|
||||
int C_TreeItem::getNumChildren() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumchildren_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::setLabel(const wchar_t *label)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(label);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setlabel_id, params);
|
||||
}
|
||||
|
||||
const wchar_t *C_TreeItem::getLabel()
|
||||
{
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getlabel_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::ensureVisible() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ensurevisible_id, NULL);
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getNthChild(int nth) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(nth);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnthchild_id, params));
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getChild() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getchild_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getChildSibling(ScriptObject *_item) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_OBJECT(_item);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getchildsibling_id, params));
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getSibling() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsibling_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getParent() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getparent_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::editLabel() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), editlabel_id, NULL);
|
||||
}
|
||||
|
||||
int C_TreeItem::hasSubItems() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), hassubitems_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::setSorted(int issorted) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(issorted);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setsorted_id, params);
|
||||
}
|
||||
|
||||
void C_TreeItem::setChildTab(int haschildtab) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(haschildtab);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setchildtab_id, params);
|
||||
}
|
||||
|
||||
int C_TreeItem::isSorted() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), issorted_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::isCollapsed() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), iscollapsed_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::isExpanded() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isexpanded_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::invalidate() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), invalidate_id, NULL);
|
||||
}
|
||||
|
||||
int C_TreeItem::isSelected() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isselected_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::isHilited() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ishilited_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::setHilited(int ishilited) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(ishilited);
|
||||
scriptVar *params[1] = {&a};
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), sethilited_id, params);
|
||||
}
|
||||
|
||||
int C_TreeItem::collapse() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), collapse_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::expand() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), expand_id, NULL));
|
||||
}
|
||||
|
||||
ScriptObject *C_TreeItem::getTree() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettree_id, NULL));
|
||||
}
|
||||
|
||||
void C_TreeItem::onTreeAdd() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontreeadd_id, NULL);
|
||||
}
|
||||
|
||||
void C_TreeItem::onTreeRemove() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontreeremove_id, NULL);
|
||||
}
|
||||
|
||||
void C_TreeItem::onSelect() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onselect_id, NULL);
|
||||
}
|
||||
|
||||
void C_TreeItem::onDeselect() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondeselect_id, NULL);
|
||||
}
|
||||
|
||||
int C_TreeItem::onLeftDoubleClick() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftdoubleclick_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::onRightDoubleClick() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightdoubleclick_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::onChar(int key) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(key);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onchar_id, params));
|
||||
}
|
||||
|
||||
void C_TreeItem::onExpand() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onexpand_id, NULL);
|
||||
}
|
||||
|
||||
void C_TreeItem::onCollapse() {
|
||||
ASSERT(inited);
|
||||
WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncollapse_id, NULL);
|
||||
}
|
||||
|
||||
int C_TreeItem::onBeginLabelEdit() {
|
||||
ASSERT(inited);
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onbeginlabeledit_id, NULL));
|
||||
}
|
||||
|
||||
int C_TreeItem::onEndLabelEdit(const wchar_t *newlabel)
|
||||
{
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_STRING(newlabel);
|
||||
scriptVar *params[1] = {&a};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onendlabeledit_id, params));
|
||||
}
|
||||
|
||||
int C_TreeItem::onContextMenu(int x, int y) {
|
||||
ASSERT(inited);
|
||||
scriptVar a = MAKE_SCRIPT_INT(x);
|
||||
scriptVar b = MAKE_SCRIPT_INT(y);
|
||||
scriptVar *params[2] = {&a, &b};
|
||||
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncontextmenu_id, params));
|
||||
}
|
||||
|
||||
int C_TreeItem::loaded=0;
|
||||
int C_TreeItem::getnumchildren_id=0;
|
||||
int C_TreeItem::setlabel_id=0;
|
||||
int C_TreeItem::getlabel_id=0;
|
||||
int C_TreeItem::ensurevisible_id=0;
|
||||
int C_TreeItem::getnthchild_id=0;
|
||||
int C_TreeItem::getchild_id=0;
|
||||
int C_TreeItem::getchildsibling_id=0;
|
||||
int C_TreeItem::getsibling_id=0;
|
||||
int C_TreeItem::getparent_id=0;
|
||||
int C_TreeItem::editlabel_id=0;
|
||||
int C_TreeItem::hassubitems_id=0;
|
||||
int C_TreeItem::setsorted_id=0;
|
||||
int C_TreeItem::setchildtab_id=0;
|
||||
int C_TreeItem::issorted_id=0;
|
||||
int C_TreeItem::iscollapsed_id=0;
|
||||
int C_TreeItem::isexpanded_id=0;
|
||||
int C_TreeItem::invalidate_id=0;
|
||||
int C_TreeItem::isselected_id=0;
|
||||
int C_TreeItem::ishilited_id=0;
|
||||
int C_TreeItem::sethilited_id=0;
|
||||
int C_TreeItem::collapse_id=0;
|
||||
int C_TreeItem::expand_id=0;
|
||||
int C_TreeItem::gettree_id=0;
|
||||
int C_TreeItem::ontreeadd_id=0;
|
||||
int C_TreeItem::ontreeremove_id=0;
|
||||
int C_TreeItem::onselect_id=0;
|
||||
int C_TreeItem::ondeselect_id=0;
|
||||
int C_TreeItem::onleftdoubleclick_id=0;
|
||||
int C_TreeItem::onrightdoubleclick_id=0;
|
||||
int C_TreeItem::onchar_id=0;
|
||||
int C_TreeItem::onexpand_id=0;
|
||||
int C_TreeItem::oncollapse_id=0;
|
||||
int C_TreeItem::onbeginlabeledit_id=0;
|
||||
int C_TreeItem::onendlabeledit_id=0;
|
||||
int C_TreeItem::oncontextmenu_id=0;
|
99
Src/Wasabi/api/script/objects/c_script/c_treeitem.h
Normal file
99
Src/Wasabi/api/script/objects/c_script/c_treeitem.h
Normal file
|
@ -0,0 +1,99 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __C_TREEITEM_H
|
||||
#define __C_TREEITEM_H
|
||||
|
||||
#include "c_rootobj.h"
|
||||
|
||||
#define C_TREEITEM_PARENT C_RootObject
|
||||
|
||||
class C_TreeItem : public C_TREEITEM_PARENT {
|
||||
public:
|
||||
|
||||
C_TreeItem(ScriptObject *object);
|
||||
C_TreeItem();
|
||||
virtual ~C_TreeItem();
|
||||
|
||||
virtual void C_hook(ScriptObject *o);
|
||||
|
||||
ScriptObject *getScriptObject();
|
||||
|
||||
virtual int getNumChildren();
|
||||
virtual void setLabel(const wchar_t *label);
|
||||
virtual const wchar_t *getLabel();
|
||||
virtual void ensureVisible();
|
||||
virtual ScriptObject *getNthChild(int nth);
|
||||
virtual ScriptObject *getChild();
|
||||
virtual ScriptObject *getChildSibling(ScriptObject *_item);
|
||||
virtual ScriptObject *getSibling();
|
||||
virtual ScriptObject *getParent();
|
||||
virtual void editLabel();
|
||||
virtual int hasSubItems();
|
||||
virtual void setSorted(int issorted);
|
||||
virtual void setChildTab(int haschildtab);
|
||||
virtual int isSorted();
|
||||
virtual int isCollapsed();
|
||||
virtual int isExpanded();
|
||||
virtual void invalidate();
|
||||
virtual int isSelected();
|
||||
virtual int isHilited();
|
||||
virtual void setHilited(int ishilited);
|
||||
virtual int collapse();
|
||||
virtual int expand();
|
||||
virtual ScriptObject *getTree();
|
||||
virtual void onTreeAdd();
|
||||
virtual void onTreeRemove();
|
||||
virtual void onSelect();
|
||||
virtual void onDeselect();
|
||||
virtual int onLeftDoubleClick();
|
||||
virtual int onRightDoubleClick();
|
||||
virtual int onChar(int key);
|
||||
virtual void onExpand();
|
||||
virtual void onCollapse();
|
||||
virtual int onBeginLabelEdit();
|
||||
virtual int onEndLabelEdit(const wchar_t *newlabel);
|
||||
virtual int onContextMenu(int x, int y);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int getnumchildren_id;
|
||||
static int setlabel_id;
|
||||
static int getlabel_id;
|
||||
static int ensurevisible_id;
|
||||
static int getnthchild_id;
|
||||
static int getchild_id;
|
||||
static int getchildsibling_id;
|
||||
static int getsibling_id;
|
||||
static int getparent_id;
|
||||
static int editlabel_id;
|
||||
static int hassubitems_id;
|
||||
static int setsorted_id;
|
||||
static int setchildtab_id;
|
||||
static int issorted_id;
|
||||
static int iscollapsed_id;
|
||||
static int isexpanded_id;
|
||||
static int invalidate_id;
|
||||
static int isselected_id;
|
||||
static int ishilited_id;
|
||||
static int sethilited_id;
|
||||
static int collapse_id;
|
||||
static int expand_id;
|
||||
static int gettree_id;
|
||||
static int ontreeadd_id;
|
||||
static int ontreeremove_id;
|
||||
static int onselect_id;
|
||||
static int ondeselect_id;
|
||||
static int onleftdoubleclick_id;
|
||||
static int onrightdoubleclick_id;
|
||||
static int onchar_id;
|
||||
static int onexpand_id;
|
||||
static int oncollapse_id;
|
||||
static int onbeginlabeledit_id;
|
||||
static int onendlabeledit_id;
|
||||
static int oncontextmenu_id;
|
||||
};
|
||||
|
||||
#endif
|
22
Src/Wasabi/api/script/objects/c_script/gen.m
Normal file
22
Src/Wasabi/api/script/objects/c_script/gen.m
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <lib/std.mi>
|
||||
|
||||
#export_cclass GuiObject
|
||||
#export_cclass Browser
|
||||
#export_cclass Button
|
||||
#export_cclass Container
|
||||
#export_cclass DropDownList
|
||||
#export_cclass Edit
|
||||
#export_cclass Group
|
||||
#export_cclass GuiList
|
||||
#export_cclass GuiTree
|
||||
#export_cclass Layout
|
||||
#export_cclass MenuButton
|
||||
#export_cclass Slider
|
||||
#export_cclass Text
|
||||
#export_cclass ToggleButton
|
||||
#export_cclass TreeItem
|
||||
#export_cclass CheckBox
|
||||
#export_cclass GroupList
|
||||
#export_cclass TabSheet
|
||||
|
||||
#abort "All done."
|
85
Src/Wasabi/api/script/objects/c_script/h_browser.cpp
Normal file
85
Src/Wasabi/api/script/objects/c_script/h_browser.cpp
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_browser.h"
|
||||
|
||||
H_Browser::H_Browser(ScriptObject *o) : H_GuiObject(o)
|
||||
{
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_Browser::H_Browser()
|
||||
{
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_Browser::H_hook(ScriptObject *o)
|
||||
{
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, browserGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &browserGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter)
|
||||
{
|
||||
onbeforenavigate_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onBeforeNavigate", this);
|
||||
ondocumentcomplete_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onDocumentComplete", this);
|
||||
onmedialink_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onMediaLink", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_Browser::~H_Browser()
|
||||
{
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_Browser::getHookedObject()
|
||||
{
|
||||
if (obj != NULL) return obj;
|
||||
return H_BROWSER_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_Browser::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams)
|
||||
{
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_BROWSER_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
|
||||
if (dlfid == onbeforenavigate_id)
|
||||
{
|
||||
hook_onBeforeNavigate(GET_SCRIPT_STRING(*params[0]), GET_SCRIPT_INT(*params[1]), GET_SCRIPT_STRING(*params[2]));
|
||||
return 1;
|
||||
}
|
||||
else if (dlfid == ondocumentcomplete_id)
|
||||
{
|
||||
hook_onDocumentComplete(GET_SCRIPT_STRING(*params[0]));
|
||||
return 1;
|
||||
}
|
||||
else if (dlfid == onmedialink_id)
|
||||
{
|
||||
|
||||
hook_onMediaLink(GET_SCRIPT_STRING(*params[0]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int H_Browser::onbeforenavigate_id=0;
|
||||
int H_Browser::ondocumentcomplete_id=0;
|
||||
int H_Browser::onmedialink_id=0;
|
||||
int H_Browser::loaded=0;
|
35
Src/Wasabi/api/script/objects/c_script/h_browser.h
Normal file
35
Src/Wasabi/api/script/objects/c_script/h_browser.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_BROWSER_H
|
||||
#define __HOOK_BROWSER_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_BROWSER_PARENT H_GuiObject
|
||||
|
||||
class H_Browser : public H_BROWSER_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_Browser(ScriptObject *o);
|
||||
H_Browser();
|
||||
virtual ~H_Browser();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onBeforeNavigate(const wchar_t *url, int flags, const wchar_t *targetframename) { }
|
||||
virtual void hook_onDocumentComplete(const wchar_t *url) { }
|
||||
virtual void hook_onMediaLink(const wchar_t *url) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onbeforenavigate_id;
|
||||
static int ondocumentcomplete_id;
|
||||
static int onmedialink_id;
|
||||
};
|
||||
|
||||
#endif
|
62
Src/Wasabi/api/script/objects/c_script/h_button.cpp
Normal file
62
Src/Wasabi/api/script/objects/c_script/h_button.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_button.h"
|
||||
|
||||
H_Button::H_Button(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_Button::H_Button() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_Button::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, buttonGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &buttonGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onactivate_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onActivate", this);
|
||||
onleftclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLeftClick", this);
|
||||
onrightclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onRightClick", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_Button::~H_Button() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_Button::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_BUTTON_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_Button::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_BUTTON_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onactivate_id) { hook_onActivate(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onleftclick_id) { hook_onLeftClick(); return 1; }
|
||||
if (dlfid == onrightclick_id) { hook_onRightClick(); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_Button::onactivate_id=0;
|
||||
int H_Button::onleftclick_id=0;
|
||||
int H_Button::onrightclick_id=0;
|
||||
int H_Button::loaded=0;
|
35
Src/Wasabi/api/script/objects/c_script/h_button.h
Normal file
35
Src/Wasabi/api/script/objects/c_script/h_button.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_BUTTON_H
|
||||
#define __HOOK_BUTTON_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_BUTTON_PARENT H_GuiObject
|
||||
|
||||
class H_Button : public H_BUTTON_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_Button(ScriptObject *o);
|
||||
H_Button();
|
||||
virtual ~H_Button();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onActivate(int activated) { }
|
||||
virtual void hook_onLeftClick() { }
|
||||
virtual void hook_onRightClick() { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onactivate_id;
|
||||
static int onleftclick_id;
|
||||
static int onrightclick_id;
|
||||
};
|
||||
|
||||
#endif
|
56
Src/Wasabi/api/script/objects/c_script/h_checkbox.cpp
Normal file
56
Src/Wasabi/api/script/objects/c_script/h_checkbox.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_checkbox.h"
|
||||
|
||||
H_CheckBox::H_CheckBox(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_CheckBox::H_CheckBox() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_CheckBox::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, checkBoxGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &checkBoxGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
ontoggle_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onToggle", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_CheckBox::~H_CheckBox() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_CheckBox::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_CHECKBOX_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_CheckBox::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_CHECKBOX_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == ontoggle_id) { hook_onToggle(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_CheckBox::ontoggle_id=0;
|
||||
int H_CheckBox::loaded=0;
|
31
Src/Wasabi/api/script/objects/c_script/h_checkbox.h
Normal file
31
Src/Wasabi/api/script/objects/c_script/h_checkbox.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_CHECKBOX_H
|
||||
#define __HOOK_CHECKBOX_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_CHECKBOX_PARENT H_GuiObject
|
||||
|
||||
class H_CheckBox : public H_CHECKBOX_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_CheckBox(ScriptObject *o);
|
||||
H_CheckBox();
|
||||
virtual ~H_CheckBox();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onToggle(int newstate) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int ontoggle_id;
|
||||
};
|
||||
|
||||
#endif
|
65
Src/Wasabi/api/script/objects/c_script/h_container.cpp
Normal file
65
Src/Wasabi/api/script/objects/c_script/h_container.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_container.h"
|
||||
|
||||
H_Container::H_Container(ScriptObject *o) : H_RootObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_Container::H_Container() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_Container::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, containerGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &containerGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onswitchtolayout_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onSwitchToLayout", this);
|
||||
onbeforeswitchtolayout_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onBeforeSwitchToLayout", this);
|
||||
onhidelayout_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onHideLayout", this);
|
||||
onshowlayout_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onShowLayout", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_Container::~H_Container() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_Container::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_CONTAINER_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_Container::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_CONTAINER_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onswitchtolayout_id) { hook_onSwitchToLayout(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
if (dlfid == onbeforeswitchtolayout_id) { hook_onBeforeSwitchToLayout(GET_SCRIPT_OBJECT(*params[0]), GET_SCRIPT_OBJECT(*params[1])); return 1; }
|
||||
if (dlfid == onhidelayout_id) { hook_onHideLayout(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
if (dlfid == onshowlayout_id) { hook_onShowLayout(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_Container::onswitchtolayout_id=0;
|
||||
int H_Container::onbeforeswitchtolayout_id=0;
|
||||
int H_Container::onhidelayout_id=0;
|
||||
int H_Container::onshowlayout_id=0;
|
||||
int H_Container::loaded=0;
|
37
Src/Wasabi/api/script/objects/c_script/h_container.h
Normal file
37
Src/Wasabi/api/script/objects/c_script/h_container.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_CONTAINER_H
|
||||
#define __HOOK_CONTAINER_H
|
||||
|
||||
#include "h_rootobj.h"
|
||||
|
||||
#define H_CONTAINER_PARENT H_RootObject
|
||||
|
||||
class H_Container : public H_CONTAINER_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_Container(ScriptObject *o);
|
||||
H_Container();
|
||||
virtual ~H_Container();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onSwitchToLayout(ScriptObject *newlayout) { }
|
||||
virtual void hook_onBeforeSwitchToLayout(ScriptObject *oldlayout, ScriptObject *newlayout) { }
|
||||
virtual void hook_onHideLayout(ScriptObject *_layout) { }
|
||||
virtual void hook_onShowLayout(ScriptObject *_layout) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onswitchtolayout_id;
|
||||
static int onbeforeswitchtolayout_id;
|
||||
static int onhidelayout_id;
|
||||
static int onshowlayout_id;
|
||||
};
|
||||
|
||||
#endif
|
56
Src/Wasabi/api/script/objects/c_script/h_dropdownlist.cpp
Normal file
56
Src/Wasabi/api/script/objects/c_script/h_dropdownlist.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_dropdownlist.h"
|
||||
|
||||
H_DropDownList::H_DropDownList(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_DropDownList::H_DropDownList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_DropDownList::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, dropDownListGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &dropDownListGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onselect_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onSelect", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_DropDownList::~H_DropDownList() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_DropDownList::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_DROPDOWNLIST_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_DropDownList::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_DROPDOWNLIST_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onselect_id) { hook_onSelect(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_DropDownList::onselect_id=0;
|
||||
int H_DropDownList::loaded=0;
|
31
Src/Wasabi/api/script/objects/c_script/h_dropdownlist.h
Normal file
31
Src/Wasabi/api/script/objects/c_script/h_dropdownlist.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_DROPDOWNLIST_H
|
||||
#define __HOOK_DROPDOWNLIST_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_DROPDOWNLIST_PARENT H_GuiObject
|
||||
|
||||
class H_DropDownList : public H_DROPDOWNLIST_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_DropDownList(ScriptObject *o);
|
||||
H_DropDownList();
|
||||
virtual ~H_DropDownList();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onSelect(int id, int hover) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onselect_id;
|
||||
};
|
||||
|
||||
#endif
|
65
Src/Wasabi/api/script/objects/c_script/h_edit.cpp
Normal file
65
Src/Wasabi/api/script/objects/c_script/h_edit.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_edit.h"
|
||||
|
||||
H_Edit::H_Edit(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_Edit::H_Edit() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_Edit::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, editGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &editGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onenter_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onEnter", this);
|
||||
onabort_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onAbort", this);
|
||||
onidleeditupdate_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onIdleEditUpdate", this);
|
||||
oneditupdate_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onEditUpdate", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_Edit::~H_Edit() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_Edit::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_EDIT_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_Edit::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_EDIT_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onenter_id) { hook_onEnter(); return 1; }
|
||||
if (dlfid == onabort_id) { hook_onAbort(); return 1; }
|
||||
if (dlfid == onidleeditupdate_id) { hook_onIdleEditUpdate(); return 1; }
|
||||
if (dlfid == oneditupdate_id) { hook_onEditUpdate(); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_Edit::onenter_id=0;
|
||||
int H_Edit::onabort_id=0;
|
||||
int H_Edit::onidleeditupdate_id=0;
|
||||
int H_Edit::oneditupdate_id=0;
|
||||
int H_Edit::loaded=0;
|
37
Src/Wasabi/api/script/objects/c_script/h_edit.h
Normal file
37
Src/Wasabi/api/script/objects/c_script/h_edit.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_EDIT_H
|
||||
#define __HOOK_EDIT_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_EDIT_PARENT H_GuiObject
|
||||
|
||||
class H_Edit : public H_EDIT_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_Edit(ScriptObject *o);
|
||||
H_Edit();
|
||||
virtual ~H_Edit();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onEnter() { }
|
||||
virtual void hook_onAbort() { }
|
||||
virtual void hook_onIdleEditUpdate() { }
|
||||
virtual void hook_onEditUpdate() { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onenter_id;
|
||||
static int onabort_id;
|
||||
static int onidleeditupdate_id;
|
||||
static int oneditupdate_id;
|
||||
};
|
||||
|
||||
#endif
|
56
Src/Wasabi/api/script/objects/c_script/h_group.cpp
Normal file
56
Src/Wasabi/api/script/objects/c_script/h_group.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_group.h"
|
||||
|
||||
H_Group::H_Group(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_Group::H_Group() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_Group::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, groupGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &groupGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
oncreateobject_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onCreateObject", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_Group::~H_Group() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_Group::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_GROUP_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_Group::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_GROUP_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == oncreateobject_id) { hook_onCreateObject(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_Group::oncreateobject_id=0;
|
||||
int H_Group::loaded=0;
|
31
Src/Wasabi/api/script/objects/c_script/h_group.h
Normal file
31
Src/Wasabi/api/script/objects/c_script/h_group.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_GROUP_H
|
||||
#define __HOOK_GROUP_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_GROUP_PARENT H_GuiObject
|
||||
|
||||
class H_Group : public H_GROUP_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_Group(ScriptObject *o);
|
||||
H_Group();
|
||||
virtual ~H_Group();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onCreateObject(ScriptObject *newobj) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int oncreateobject_id;
|
||||
};
|
||||
|
||||
#endif
|
53
Src/Wasabi/api/script/objects/c_script/h_grouplist.cpp
Normal file
53
Src/Wasabi/api/script/objects/c_script/h_grouplist.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
#include <api/api.h>
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_grouplist.h"
|
||||
|
||||
H_GroupList::H_GroupList(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_GroupList::H_GroupList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_GroupList::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, groupListGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &groupListGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_GroupList::~H_GroupList() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_GroupList::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_GROUPLIST_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_GroupList::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_GROUPLIST_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_GroupList::loaded=0;
|
29
Src/Wasabi/api/script/objects/c_script/h_grouplist.h
Normal file
29
Src/Wasabi/api/script/objects/c_script/h_grouplist.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_GROUPLIST_H
|
||||
#define __HOOK_GROUPLIST_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_GROUPLIST_PARENT H_GuiObject
|
||||
|
||||
class H_GroupList : public H_GROUPLIST_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_GroupList(ScriptObject *o);
|
||||
H_GroupList();
|
||||
virtual ~H_GroupList();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
};
|
||||
|
||||
#endif
|
83
Src/Wasabi/api/script/objects/c_script/h_guilist.cpp
Normal file
83
Src/Wasabi/api/script/objects/c_script/h_guilist.cpp
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_guilist.h"
|
||||
|
||||
H_GuiList::H_GuiList(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_GuiList::H_GuiList() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_GuiList::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, guiListGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &guiListGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onsetvisible_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onSetVisible", this);
|
||||
onselectall_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onSelectAll", this);
|
||||
ondelete_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onDelete", this);
|
||||
ondoubleclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onDoubleClick", this);
|
||||
onleftclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLeftClick", this);
|
||||
onsecondleftclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onSecondLeftClick", this);
|
||||
onrightclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onRightClick", this);
|
||||
oncolumndblclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onColumnDblClick", this);
|
||||
oncolumnlabelclick_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onColumnLabelClick", this);
|
||||
onitemselection_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemSelection", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_GuiList::~H_GuiList() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_GuiList::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_GUILIST_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_GuiList::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_GUILIST_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onsetvisible_id) { hook_onSetVisible(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onselectall_id) { hook_onSelectAll(); return 1; }
|
||||
if (dlfid == ondelete_id) { hook_onDelete(); return 1; }
|
||||
if (dlfid == ondoubleclick_id) { hook_onDoubleClick(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onleftclick_id) { hook_onLeftClick(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onsecondleftclick_id) { hook_onSecondLeftClick(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onrightclick_id) { hook_onRightClick(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == oncolumndblclick_id) { hook_onColumnDblClick(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1]), GET_SCRIPT_INT(*params[2])); return 1; }
|
||||
if (dlfid == oncolumnlabelclick_id) { hook_onColumnLabelClick(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1]), GET_SCRIPT_INT(*params[2])); return 1; }
|
||||
if (dlfid == onitemselection_id) { hook_onItemSelection(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_GuiList::onsetvisible_id=0;
|
||||
int H_GuiList::onselectall_id=0;
|
||||
int H_GuiList::ondelete_id=0;
|
||||
int H_GuiList::ondoubleclick_id=0;
|
||||
int H_GuiList::onleftclick_id=0;
|
||||
int H_GuiList::onsecondleftclick_id=0;
|
||||
int H_GuiList::onrightclick_id=0;
|
||||
int H_GuiList::oncolumndblclick_id=0;
|
||||
int H_GuiList::oncolumnlabelclick_id=0;
|
||||
int H_GuiList::onitemselection_id=0;
|
||||
int H_GuiList::loaded=0;
|
49
Src/Wasabi/api/script/objects/c_script/h_guilist.h
Normal file
49
Src/Wasabi/api/script/objects/c_script/h_guilist.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_GUILIST_H
|
||||
#define __HOOK_GUILIST_H
|
||||
|
||||
#include "h_guiobject.h"
|
||||
|
||||
#define H_GUILIST_PARENT H_GuiObject
|
||||
|
||||
class H_GuiList : public H_GUILIST_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_GuiList(ScriptObject *o);
|
||||
H_GuiList();
|
||||
virtual ~H_GuiList();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onSetVisible(int show) { }
|
||||
virtual void hook_onSelectAll() { }
|
||||
virtual void hook_onDelete() { }
|
||||
virtual void hook_onDoubleClick(int itemnum) { }
|
||||
virtual void hook_onLeftClick(int itemnum) { }
|
||||
virtual void hook_onSecondLeftClick(int itemnum) { }
|
||||
virtual void hook_onRightClick(int itemnum) { }
|
||||
virtual void hook_onColumnDblClick(int col, int x, int y) { }
|
||||
virtual void hook_onColumnLabelClick(int col, int x, int y) { }
|
||||
virtual void hook_onItemSelection(int itemnum, int selected) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onsetvisible_id;
|
||||
static int onselectall_id;
|
||||
static int ondelete_id;
|
||||
static int ondoubleclick_id;
|
||||
static int onleftclick_id;
|
||||
static int onsecondleftclick_id;
|
||||
static int onrightclick_id;
|
||||
static int oncolumndblclick_id;
|
||||
static int oncolumnlabelclick_id;
|
||||
static int onitemselection_id;
|
||||
};
|
||||
|
||||
#endif
|
117
Src/Wasabi/api/script/objects/c_script/h_guiobject.cpp
Normal file
117
Src/Wasabi/api/script/objects/c_script/h_guiobject.cpp
Normal file
|
@ -0,0 +1,117 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_guiobject.h"
|
||||
#include "../nu/AUtoChar.h"
|
||||
|
||||
H_GuiObject::H_GuiObject(ScriptObject *o) : H_RootObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_GuiObject::H_GuiObject() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_GuiObject::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, guiObjectGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &guiObjectGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onsetvisible_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onSetVisible", this);
|
||||
onleftbuttonup_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLeftButtonUp", this);
|
||||
onleftbuttondown_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLeftButtonDown", this);
|
||||
onrightbuttonup_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onRightButtonUp", this);
|
||||
onrightbuttondown_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onRightButtonDown", this);
|
||||
onrightbuttondblclk_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onRightButtonDblClk", this);
|
||||
onleftbuttondblclk_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLeftButtonDblClk", this);
|
||||
onmousemove_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onMouseMove", this);
|
||||
onenterarea_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onEnterArea", this);
|
||||
onleavearea_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLeaveArea", this);
|
||||
onenable_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onEnable", this);
|
||||
onresize_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onResize", this);
|
||||
ontargetreached_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onTargetReached", this);
|
||||
onstartup_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onStartup", this);
|
||||
onchar_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onChar", this);
|
||||
onaccelerator_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onAccelerator", this);
|
||||
onkeydown_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onKeyDown", this);
|
||||
onkeyup_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onKeyUp", this);
|
||||
ongetfocus_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onGetFocus", this);
|
||||
onkillfocus_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onKillFocus", this);
|
||||
onaction_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onAction", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_GuiObject::~H_GuiObject() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_GuiObject::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_GUIOBJECT_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_GuiObject::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_GUIOBJECT_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onsetvisible_id) { hook_onSetVisible(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onleftbuttonup_id) { hook_onLeftButtonUp(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onleftbuttondown_id) { hook_onLeftButtonDown(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onrightbuttonup_id) { hook_onRightButtonUp(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onrightbuttondown_id) { hook_onRightButtonDown(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onrightbuttondblclk_id) { hook_onRightButtonDblClk(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onleftbuttondblclk_id) { hook_onLeftButtonDblClk(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onmousemove_id) { hook_onMouseMove(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onenterarea_id) { hook_onEnterArea(); return 1; }
|
||||
if (dlfid == onleavearea_id) { hook_onLeaveArea(); return 1; }
|
||||
if (dlfid == onenable_id) { hook_onEnable(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onresize_id) { hook_onResize(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1]), GET_SCRIPT_INT(*params[2]), GET_SCRIPT_INT(*params[3])); return 1; }
|
||||
if (dlfid == ontargetreached_id) { hook_onTargetReached(); return 1; }
|
||||
if (dlfid == onstartup_id) { hook_onStartup(); return 1; }
|
||||
if (dlfid == onchar_id) { hook_onChar(GET_SCRIPT_STRING(*params[0])); return 1; }
|
||||
if (dlfid == onaccelerator_id) { hook_onAccelerator(GET_SCRIPT_STRING(*params[0])); return 1; }
|
||||
if (dlfid == onkeydown_id) { hook_onKeyDown(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onkeyup_id) { hook_onKeyUp(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == ongetfocus_id) { hook_onGetFocus(); return 1; }
|
||||
if (dlfid == onkillfocus_id) { hook_onKillFocus(); return 1; }
|
||||
if (dlfid == onaction_id) { hook_onAction(GET_SCRIPT_STRING(*params[0]), GET_SCRIPT_STRING(*params[1]), GET_SCRIPT_INT(*params[2]), GET_SCRIPT_INT(*params[3]), GET_SCRIPT_INT(*params[4]), GET_SCRIPT_INT(*params[5]), GET_SCRIPT_OBJECT(*params[6])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_GuiObject::onsetvisible_id=0;
|
||||
int H_GuiObject::onleftbuttonup_id=0;
|
||||
int H_GuiObject::onleftbuttondown_id=0;
|
||||
int H_GuiObject::onrightbuttonup_id=0;
|
||||
int H_GuiObject::onrightbuttondown_id=0;
|
||||
int H_GuiObject::onrightbuttondblclk_id=0;
|
||||
int H_GuiObject::onleftbuttondblclk_id=0;
|
||||
int H_GuiObject::onmousemove_id=0;
|
||||
int H_GuiObject::onenterarea_id=0;
|
||||
int H_GuiObject::onleavearea_id=0;
|
||||
int H_GuiObject::onenable_id=0;
|
||||
int H_GuiObject::onresize_id=0;
|
||||
int H_GuiObject::ontargetreached_id=0;
|
||||
int H_GuiObject::onstartup_id=0;
|
||||
int H_GuiObject::onchar_id=0;
|
||||
int H_GuiObject::onaccelerator_id=0;
|
||||
int H_GuiObject::onkeydown_id=0;
|
||||
int H_GuiObject::onkeyup_id=0;
|
||||
int H_GuiObject::ongetfocus_id=0;
|
||||
int H_GuiObject::onkillfocus_id=0;
|
||||
int H_GuiObject::onaction_id=0;
|
||||
int H_GuiObject::loaded=0;
|
71
Src/Wasabi/api/script/objects/c_script/h_guiobject.h
Normal file
71
Src/Wasabi/api/script/objects/c_script/h_guiobject.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#ifndef __HOOK_GUIOBJECT_H
|
||||
#define __HOOK_GUIOBJECT_H
|
||||
|
||||
#include "h_rootobj.h"
|
||||
|
||||
#define H_GUIOBJECT_PARENT H_RootObject
|
||||
|
||||
class H_GuiObject : public H_GUIOBJECT_PARENT {
|
||||
|
||||
public:
|
||||
|
||||
H_GuiObject(ScriptObject *o);
|
||||
H_GuiObject();
|
||||
virtual ~H_GuiObject();
|
||||
virtual void H_hook(ScriptObject *o);
|
||||
ScriptObject *getHookedObject();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
virtual void hook_onSetVisible(int onoff) { }
|
||||
virtual void hook_onLeftButtonUp(int x, int y) { }
|
||||
virtual void hook_onLeftButtonDown(int x, int y) { }
|
||||
virtual void hook_onRightButtonUp(int x, int y) { }
|
||||
virtual void hook_onRightButtonDown(int x, int y) { }
|
||||
virtual void hook_onRightButtonDblClk(int x, int y) { }
|
||||
virtual void hook_onLeftButtonDblClk(int x, int y) { }
|
||||
virtual void hook_onMouseMove(int x, int y) { }
|
||||
virtual void hook_onEnterArea() { }
|
||||
virtual void hook_onLeaveArea() { }
|
||||
virtual void hook_onEnable(int onoff) { }
|
||||
virtual void hook_onResize(int x, int y, int w, int h) { }
|
||||
virtual void hook_onTargetReached() { }
|
||||
virtual void hook_onStartup() { }
|
||||
virtual void hook_onChar(const wchar_t *c) { }
|
||||
virtual void hook_onAccelerator(const wchar_t *accel) { }
|
||||
virtual void hook_onKeyDown(int vk_code) { }
|
||||
virtual void hook_onKeyUp(int vk_code) { }
|
||||
virtual void hook_onGetFocus() { }
|
||||
virtual void hook_onKillFocus() { }
|
||||
virtual void hook_onAction(const wchar_t *action, const wchar_t *param, int x, int y, int p1, int p2, ScriptObject *source) { }
|
||||
|
||||
private:
|
||||
|
||||
ScriptObject *obj;
|
||||
int inited;
|
||||
static int loaded;
|
||||
static int onsetvisible_id;
|
||||
static int onleftbuttonup_id;
|
||||
static int onleftbuttondown_id;
|
||||
static int onrightbuttonup_id;
|
||||
static int onrightbuttondown_id;
|
||||
static int onrightbuttondblclk_id;
|
||||
static int onleftbuttondblclk_id;
|
||||
static int onmousemove_id;
|
||||
static int onenterarea_id;
|
||||
static int onleavearea_id;
|
||||
static int onenable_id;
|
||||
static int onresize_id;
|
||||
static int ontargetreached_id;
|
||||
static int onstartup_id;
|
||||
static int onchar_id;
|
||||
static int onaccelerator_id;
|
||||
static int onkeydown_id;
|
||||
static int onkeyup_id;
|
||||
static int ongetfocus_id;
|
||||
static int onkillfocus_id;
|
||||
static int onaction_id;
|
||||
};
|
||||
|
||||
#endif
|
80
Src/Wasabi/api/script/objects/c_script/h_guitree.cpp
Normal file
80
Src/Wasabi/api/script/objects/c_script/h_guitree.cpp
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* This file was generated by Maki Compiler, do not edit manually */
|
||||
|
||||
#include <precomp.h>
|
||||
|
||||
#include <api/script/objcontroller.h>
|
||||
#include "h_guitree.h"
|
||||
|
||||
H_GuiTree::H_GuiTree(ScriptObject *o) : H_GuiObject(o) {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
H_hook(o);
|
||||
}
|
||||
|
||||
H_GuiTree::H_GuiTree() {
|
||||
inited = 0;
|
||||
obj = NULL;
|
||||
}
|
||||
|
||||
void H_GuiTree::H_hook(ScriptObject *o) {
|
||||
ASSERT(!inited);
|
||||
ScriptObjectController *controller = o->vcpu_getController();
|
||||
obj = controller->cast(o, guiTreeGuid);
|
||||
if (obj != o && obj != NULL)
|
||||
o = obj;
|
||||
else
|
||||
obj = NULL;
|
||||
|
||||
addMonitorObject(o, &guiTreeGuid);
|
||||
|
||||
int iter = WASABI_API_APP->app_getInitCount();
|
||||
if (!loaded || loaded != iter) {
|
||||
onwantautocontextmenu_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onWantAutoContextMenu", this);
|
||||
onmousewheelup_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onMouseWheelUp", this);
|
||||
onmousewheeldown_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onMouseWheelDown", this);
|
||||
oncontextmenu_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onContextMenu", this);
|
||||
onchar_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onChar", this);
|
||||
onitemrecvdrop_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemRecvDrop", this);
|
||||
onlabelchange_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLabelChange", this);
|
||||
onitemselected_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemSelected", this);
|
||||
onitemdeselected_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemDeselected", this);
|
||||
loaded = 1;
|
||||
}
|
||||
inited=1;
|
||||
}
|
||||
|
||||
H_GuiTree::~H_GuiTree() {
|
||||
if (!inited) return;
|
||||
WASABI_API_MAKI->maki_remDlfRef(this);
|
||||
}
|
||||
|
||||
ScriptObject *H_GuiTree::getHookedObject() {
|
||||
if (obj != NULL) return obj;
|
||||
return H_GUITREE_PARENT::getHookedObject();
|
||||
}
|
||||
|
||||
int H_GuiTree::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
if (object != getHookedObject()) return 0;
|
||||
if (H_GUITREE_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
|
||||
if (dlfid == onwantautocontextmenu_id) { hook_onWantAutoContextMenu(); return 1; }
|
||||
if (dlfid == onmousewheelup_id) { hook_onMouseWheelUp(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onmousewheeldown_id) { hook_onMouseWheelDown(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == oncontextmenu_id) { hook_onContextMenu(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
|
||||
if (dlfid == onchar_id) { hook_onChar(GET_SCRIPT_INT(*params[0])); return 1; }
|
||||
if (dlfid == onitemrecvdrop_id) { hook_onItemRecvDrop(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
if (dlfid == onlabelchange_id) { hook_onLabelChange(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
if (dlfid == onitemselected_id) { hook_onItemSelected(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
if (dlfid == onitemdeselected_id) { hook_onItemDeselected(GET_SCRIPT_OBJECT(*params[0])); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int H_GuiTree::onwantautocontextmenu_id=0;
|
||||
int H_GuiTree::onmousewheelup_id=0;
|
||||
int H_GuiTree::onmousewheeldown_id=0;
|
||||
int H_GuiTree::oncontextmenu_id=0;
|
||||
int H_GuiTree::onchar_id=0;
|
||||
int H_GuiTree::onitemrecvdrop_id=0;
|
||||
int H_GuiTree::onlabelchange_id=0;
|
||||
int H_GuiTree::onitemselected_id=0;
|
||||
int H_GuiTree::onitemdeselected_id=0;
|
||||
int H_GuiTree::loaded=0;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue