00001 /* 00002 Copyright (C) 1999 Carsten Winkelholz 00003 00004 Address: FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V. 00005 Neuenahrer Str. 20 00006 D - 53343 Wachtberg 00007 00008 Email: winkelholz@fgan.de 00009 00010 This program is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU General Public License 00012 as published by the Free Software Foundation; either version 2 00013 of the License, or (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 */ 00024 00025 00026 #ifndef CYBJSMSGPSGC_H 00027 #define CYBJSMSGPSGC_H 00028 00029 #include "oaw/ctk/cybmsgpsgc.h" 00030 #include "jsWRLtypes.h" 00031 #include "oaw/misc/mapc.h" 00032 00033 00034 /* include the JS engine API header */ 00035 #include "jsapi.h" 00036 00037 #include "../oawconfig.h" 00038 00039 OAW_BEGIN_NAMESPACE 00040 00041 00042 class OAW_DLLMAPPING CybJSMsgPsgC : public CybMsgPsgC 00043 { 00044 public: 00045 CybJSMsgPsgC(); 00046 virtual ~CybJSMsgPsgC(); 00047 CybJSMsgPsgC(const CybJSMsgPsgC&); 00048 CybJSMsgPsgC& operator = (const CybJSMsgPsgC&); 00049 00050 public: 00051 //Initilization 00052 virtual short SetPartnerProc(const char*); 00053 virtual void TerminateInit(); 00054 virtual short ProcessEvents(short); 00055 virtual long GetNodeEventsDataMaxLength(); 00056 virtual short SetField(void*,long); 00057 00058 public: 00059 void FieldAccessed(const char*); 00060 00061 protected: 00062 virtual void callInitialize(const TimeC&); 00063 virtual void callEventsProcessed(const TimeC&); 00064 virtual void callShutdown(const TimeC&); 00065 virtual void callEventCascadeBegin(const TimeC&); 00066 virtual void callEventCascadeEnd(const TimeC&); 00067 00068 void JSFuncCallBegin(); 00069 void JSFuncCallEnd(); 00070 00071 protected: 00072 StringC m_partnerProc; 00073 StringC m_code; 00074 00075 JSRuntime* m_jsRt; 00076 JSContext* m_jsCx; 00077 JSObject* m_jsGlobalObj; 00078 00079 jsPrivate* m_jspGlobalPrivate; 00080 00081 MapC<StringC,long> m_eventOutNameMap; 00082 ArrayC<short> m_eventOutAccs; 00083 MapC<StringC,long> m_fieldNameMap; 00084 ArrayC<short> m_fieldAccs; 00085 00086 private: 00087 static JSClass js_global_class; 00088 }; 00089 00090 00091 OAW_END_NAMESPACE 00092 00093 00094 00095 #endif 00096 00097 00098 00099 00100 00101 00102
1.3-rc2