My Project
Public Types | Public Member Functions | List of all members
ParaEngine::IParaWebPlayer Class Referenceabstract

ParaPhysics core interface. More...

#include <IParaWebPlayer.h>

Public Types

enum  PWP_MSG_CODE {
  PWP_FAILED_LOAD_PELIB, PWP_FAILED_CREATE_PEAPP, PWP_FAILED_START_PEAPP, PWP_FAILED_CREATE_DEVICE,
  PWP_FAILED_LOCATE_PARAENGINE_DIR, PWP_FAILED_CREATE_PE_AUTOUPDATER
}
 

Public Member Functions

virtual int GetVersion ()=0
 get the interface version
 
virtual bool IsDebugging ()=0
 whether this is a debug build. More...
 
virtual void FindParaEngineDirectory (const char *sHintDir)=0
 find the ParaEngine dir and set as working directory. More...
 
virtual int Start (const char *sCmdLine)=0
 start command line. More...
 
virtual bool DoCoreUpdate ()=0
 force updating the core library in the current working directory. More...
 
virtual bool BeginCoreUpdate (const char *sCurVersion, const char *sSessionDir)=0
 begin core update. More...
 
virtual bool TryGetNextCoreUpdateMessage ()=0
 same as DoCoreUpdate(), except that it allows us to poll the next message. More...
 
virtual void SetMainWindow (HWND hWnd)=0
 set the hWnd on to which we will render and process window messages. More...
 
virtual HWND GetMainWindow ()=0
 
virtual bool CustomWinProc (HWND hWnd, UINT uMsg, void *wParam, void *lParamm, void *lRes)=0
 call this function for processing main window messages in the browser main window thread. More...
 
virtual void ActivateApp (bool bActivate)=0
 the window message processor. More...
 
virtual void Release ()=0
 all this to unload the IPhysics. More...
 
virtual NPL::INPLRuntimeGetPlayerNPLRuntime ()=0
 get the NPL runtime for browser to send messages to the player.
 
virtual void SetBrowserNPLSystem (NPL::INPLRuntime *pTarget)=0
 set NPL runtime in the browser plugin. More...
 
virtual void SetRedistDir (const char *sDir)=0
 set the redist directory which contains this dll. More...
 

Detailed Description

ParaPhysics core interface.

Member Function Documentation

§ ActivateApp()

virtual void ParaEngine::IParaWebPlayer::ActivateApp ( bool  bActivate)
pure virtual

the window message processor.

One needs send all messages belonging to the main window to this function, after calling Create(). this function is called whenever the application is disabled or enabled. usually called when receiving the WM_ACTIVATEAPP message. [main thread only]

§ BeginCoreUpdate()

virtual bool ParaEngine::IParaWebPlayer::BeginCoreUpdate ( const char *  sCurVersion,
const char *  sSessionDir 
)
pure virtual

begin core update.

one can use TryGetNextCoreUpdateMessage() to process the update message.

Parameters
sCurVersion"0" is forcing full update, "" is using the current version in the current working directory. or a version number like "0.2.70"
sSessionDirwe will keep temporary download file under update/[sUpdaterName]/[version] directory. if this is NULL, we will use the default name "web"

§ CustomWinProc()

virtual bool ParaEngine::IParaWebPlayer::CustomWinProc ( HWND  hWnd,
UINT  uMsg,
void *  wParam,
void *  lParamm,
void *  lRes 
)
pure virtual

call this function for processing main window messages in the browser main window thread.

return false to let the default window message procedure process or true if intercepted.

§ DoCoreUpdate()

virtual bool ParaEngine::IParaWebPlayer::DoCoreUpdate ( )
pure virtual

force updating the core library in the current working directory.

It will send following messages. this function returns when update is complete 'updt.s': update progress started. value is msg 'updt.p': update progress report. var1 is finished count, var2 is allcount 'updt.e': error occurs during update. value is the error message. 'updt.u': unknown version detected. value is the error message. 'updt.c': completed. value is the current version. 'updt.n': no change detected. value is the current version. 'updt.b': broken file during file transfer. var1 is finished count, var2 is allcount

§ FindParaEngineDirectory()

virtual void ParaEngine::IParaWebPlayer::FindParaEngineDirectory ( const char *  sHintDir)
pure virtual

find the ParaEngine dir and set as working directory.

Parameters
sHintDirgive us a dir to search for.

§ IsDebugging()

virtual bool ParaEngine::IParaWebPlayer::IsDebugging ( )
pure virtual

whether this is a debug build.

§ Release()

virtual void ParaEngine::IParaWebPlayer::Release ( )
pure virtual

all this to unload the IPhysics.

Pointer to this class will be invalid after the call

§ SetBrowserNPLSystem()

virtual void ParaEngine::IParaWebPlayer::SetBrowserNPLSystem ( NPL::INPLRuntime pTarget)
pure virtual

set NPL runtime in the browser plugin.

so that we can send message to it.

§ SetMainWindow()

virtual void ParaEngine::IParaWebPlayer::SetMainWindow ( HWND  hWnd)
pure virtual

set the hWnd on to which we will render and process window messages.

this function should be called prior to StartApp(). If this function is not called, ParaEngine will create its own window for rendering.

Note
: the rendering device size will use the client area of the input window
Parameters
hWndthe Window on to which we will render.

§ SetRedistDir()

virtual void ParaEngine::IParaWebPlayer::SetRedistDir ( const char *  sDir)
pure virtual

set the redist directory which contains this dll.

This function is called by the browser plugin when this dll is loaded.

§ Start()

virtual int ParaEngine::IParaWebPlayer::Start ( const char *  sCmdLine)
pure virtual

start command line.

§ TryGetNextCoreUpdateMessage()

virtual bool ParaEngine::IParaWebPlayer::TryGetNextCoreUpdateMessage ( )
pure virtual

same as DoCoreUpdate(), except that it allows us to poll the next message.

typically, we can call it from a timer that periodically check if there is a new update message.


The documentation for this class was generated from the following file: