plugindll_h.htm |
Top Previous Next |
#define PLUGINDLL_API extern "C" __declspec(dllexport) #define typeVariableInt 0 #define typeVariableFloat 1 #define typeVariableString 2 #define MAX(x,y) (x>y?x:y) #define MAX3(x,y,z) MAX(MAX(x,y),z) #define MIN(x,y) (x>y?y:x) #define MIN3(x,y,z) MIN(MIN(x,y),z) // to have life easy, here are few defines of the commands // TODO: fill the rest according the lab-Talk #define MenuGetCount() (CALLSCRIPT("MenuGetCount")) #define MenuGetCurSel() (CALLSCRIPT("MenuGetCurSel")) #define MenuAdd(bIsVmg,sName,bOpen) (CALLSCRIPT2("MenuAdd",bIsVmg,sName,bOpen)) #define MenuDelete(nMenu) (CALLSCRIPT("MenuDelete",nMenu)) #define MenuActivate(nMenu) (CALLSCRIPT("MenuActivate",nMenu)) // etc #define ObjectGetCount(nMenu) (CALLSCRIPT("ObjectGetCount",nMenu)) #define ObjectGetCurSel(nMenu) (CALLSCRIPT("ObjectGetCurSel",nMenu)) #define ObjectGetType(nMenu,nObject)(CALLSCRIPT("ObjectGetType",nMenu, nObject)) // etc.. #define ObjectGetXPos(nMenu,nObject)(CALLSCRIPT("ObjectGetXPos",nMenu, nObject)) #define ObjectGetYPos(nMenu,nObject)(CALLSCRIPT("ObjectGetYPos",nMenu, nObject)) #define ObjectGetWidth(nMenu,nObject)(CALLSCRIPT("ObjectGetWidth",nMenu, nObject)) #define ObjectGetHeight(nMenu,nObject)(CALLSCRIPT("ObjectGetHeight",nMenu, nObject)) #define ObjectSetSize(nMenu,nObject,nWidth,nHeight) (CALLSCRIPT("ObjectSetSize",nMenu, nObject,nWidth,nHeight)) #define ObjectSetPos(nMenu,nObject,nX,nY) (CALLSCRIPT("ObjectSetPos",nMenu, nObject,nX,nY)) // etc... #define ImgGrabObject(imgNum,nMenu,nObject) (CALLSCRIPT("ImgGrabObject",imgNum,nMenu,nObject)) #define ImgSetToObject(imgNum,nMenu,nObject) (CALLSCRIPT("ImgSetToObject",imgNum,nMenu,nObject)) #define ImgInflate(imgNum,addW,addH) (CALLSCRIPT("ImgInflate",imgNum,addW,addH)) #define ImgBlurAlpha(imgNum,nBlur) (CALLSCRIPT("ImgBlurAlpha",imgNum,nBlur)) #define ImgGetWidth(imgNum) (CALLSCRIPT("ImgGetWidth",imgNum)) #define ImgGetHeight(imgNum) (CALLSCRIPT("ImgGetHeight",imgNum)) // etc... // etc.... // One "secret" command that is not described in lab-talk (because it has no sense there) // ImgGetRGBABuffer returns the pointer to the RGBA buffer // be careful what you writing to it! // the size of buffer is ImgGetWidth(imgNum)*ImgGetHeight(imgNum)*4 #define ImgGetRGBABuffer(imgNum) (CALLSCRIPT("ImgGetRGBABuffer",imgNum)) void RunScript(); struct _PLVariable { int m_nVariableType; float m_fValue; int m_nValue; char* m_sValue; }; typedef void (*PLCallBack)(char* sName, _PLVariable *result,_PLVariable *param1,_PLVariable *param2,_PLVariable *param3,_PLVariable *param4); PLUGINDLL_API void PL_RunScript(PLCallBack pCallback,HWND hWnd); |