#ifndef PBPSPP_H
#define PBPSPP_H
#include "pbni.h"
#ifndef PBOS_UNIX
#include "pbevtid.h"
#endif
struct IPBX_UserObject
{
virtual PBXRESULT Invoke(
IPB_Session *session,
pbobject obj,
pbmethodID mid,
PBCallInfo *ci) = 0;
virtual void Destroy() = 0;
virtual ~IPBX_UserObject(){};
};
struct IPBX_NonVisualObject : public IPBX_UserObject
{
};
#define PB_NULL -1
struct IPBX_VisualObject : public IPBX_UserObject
{
virtual LPCTSTR GetWindowClassName() = 0;
virtual HWND CreateControl(
DWORD dwExStyle, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HINSTANCE hInstance ) = 0;
virtual int GetEventID(
HWND hWnd,
UINT iMsg,
WPARAM wParam,
LPARAM lParam
)
{
return PB_NULL;
}
};
struct IPBX_Marshaler
{
virtual PBXRESULT InvokeRemoteMethod(
IPB_Session *session,
pbproxyObject obj,
LPCTSTR methodDesc,
PBCallInfo *ci) = 0;
virtual pbulong GetModuleHandle() = 0;
virtual void Destroy() = 0;
protected:
virtual ~IPBX_Marshaler(){};
};
enum pbborder_style
{
pbborderstyle_none = 0,
pbborderstyle_shadowbox = 1,
pbborderstyle_box = 2,
pbborderstyle_lowered = 5,
pbborderstyle_raised = 6
};
struct PBX_DrawItemStruct
{
int x;
int y;
int width;
int height;
LPCTSTR objectName;
LPCTSTR tag;
BOOL enabled;
BOOL visible;
pbborder_style borderStyle;
DWORD backColor;
};
extern "C"
{
PBXEXPORT LPCTSTR PBXCALL PBX_GetDescription();
PBXEXPORT PBXRESULT PBXCALL PBX_CreateNonVisualObject(
IPB_Session *pbsession,
pbobject pbobj,
LPCTSTR className,
IPBX_NonVisualObject **obj);
PBXEXPORT PBXRESULT PBXCALL PBX_CreateVisualObject(
IPB_Session *pbsession,
pbobject pbobj,
LPCTSTR className,
IPBX_VisualObject **obj);
PBXEXPORT PBXRESULT PBXCALL PBX_InvokeGlobalFunction(
IPB_Session *pbsession,
LPCTSTR functionName,
PBCallInfo *ci);
PBXEXPORT PBXRESULT PBXCALL PBX_DrawVisualObject(
HDC hDC,
LPCTSTR className,
const PBX_DrawItemStruct &property);
const pbint kAfterDllLoaded = 1;
const pbint kBeforeDllUnloaded = 2;
PBXEXPORT PBXRESULT PBXCALL PBX_Notify(
IPB_Session *pbsession,
pbint reasonForCall);
const pbint kPBVMVersion = 0x0a00;
#if defined(UNICODE) || defined(_UNICODE)
const pbint kUnicodeEnabled = 1;
#else
const pbint kUnicodeEnabled = 0;
#endif
PBXEXPORT inline long PBXCALL PBX_GetVersion()
{
return MAKELONG(kPBVMVersion, kUnicodeEnabled);
};
}
#endif