scriptobj.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // ----------------------------------------------------------------------------
  2. // Generated by InterfaceFactory [Thu May 15 21:09:17 2003]
  3. //
  4. // File : scriptobj.h
  5. // Class : ScriptObject
  6. // class layer : Dispatchable Interface
  7. // ----------------------------------------------------------------------------
  8. #ifndef __SCRIPTOBJECT_H
  9. #define __SCRIPTOBJECT_H
  10. #include <bfc/dispatch.h>
  11. #include <bfc/common.h>
  12. class ScriptHook;
  13. class ScriptObject;
  14. class ScriptObjectController;
  15. enum {
  16. INTERFACE_GENERICVOIDPTR=0,
  17. INTERFACE_SCRIPTOBJECT,
  18. };
  19. // ----------------------------------------------------------------------------
  20. class ScriptObject: public Dispatchable {
  21. protected:
  22. ScriptObject() {}
  23. ~ScriptObject() {}
  24. public:
  25. void *vcpu_getInterface(GUID g, int *interfacetype = NULL);
  26. void *vcpu_getInterfaceObject(GUID g, ScriptObject **o);
  27. int vcpu_getAssignedVariable(int start, int scriptid, int functionId, int *next, int *globalevententry, int *inheritedevent);
  28. void vcpu_removeAssignedVariable(int var, int id);
  29. void vcpu_addAssignedVariable(int var, int scriptid);
  30. const wchar_t *vcpu_getClassName();
  31. ScriptObjectController *vcpu_getController();
  32. int vcpu_getScriptId();
  33. void vcpu_setScriptId(int i);
  34. int vcpu_getMember(const wchar_t *id, int scriptid, int rettype);
  35. void vcpu_delMembers(int scriptid);
  36. void vcpu_setInterface(GUID g, void *v, int interfacetype = INTERFACE_SCRIPTOBJECT);
  37. void vcpu_setClassName(const wchar_t *name);
  38. void vcpu_setController(ScriptObjectController *c);
  39. void vcpu_init();
  40. protected:
  41. enum {
  42. SCRIPTOBJECT_VCPU_GETINTERFACE = 50,
  43. SCRIPTOBJECT_VCPU_GETINTERFACEOBJECT = 60,
  44. SCRIPTOBJECT_VCPU_GETASSIGNEDVARIABLE = 100,
  45. SCRIPTOBJECT_VCPU_REMOVEASSIGNEDVARIABLE = 200,
  46. SCRIPTOBJECT_VCPU_ADDASSIGNEDVARIABLE = 300,
  47. SCRIPTOBJECT_VCPU_GETCLASSNAME = 400,
  48. SCRIPTOBJECT_VCPU_GETCONTROLLER = 500,
  49. SCRIPTOBJECT_VCPU_ADDCLASSHOOK = 600,
  50. SCRIPTOBJECT_VCPU_ADDOBJECTHOOK = 700,
  51. SCRIPTOBJECT_VCPU_GETSCRIPTID = 800,
  52. SCRIPTOBJECT_VCPU_SETSCRIPTID = 900,
  53. SCRIPTOBJECT_VCPU_GETMEMBER = 1000,
  54. SCRIPTOBJECT_VCPU_DELMEMBERS = 1100,
  55. SCRIPTOBJECT_VCPU_SETINTERFACE = 1200,
  56. SCRIPTOBJECT_VCPU_SETCLASSNAME = 1300,
  57. SCRIPTOBJECT_VCPU_SETCONTROLLER = 1400,
  58. SCRIPTOBJECT_VCPU_INIT = 1500,
  59. };
  60. };
  61. // ----------------------------------------------------------------------------
  62. inline void *ScriptObject::vcpu_getInterface(GUID g, int *interfacetype) {
  63. void *__retval = _call(SCRIPTOBJECT_VCPU_GETINTERFACE, (void *)NULL, g, interfacetype);
  64. return __retval;
  65. }
  66. inline void *ScriptObject::vcpu_getInterfaceObject(GUID g, ScriptObject **o) {
  67. void *__retval = _call(SCRIPTOBJECT_VCPU_GETINTERFACEOBJECT, (void *)NULL, g, o);
  68. return __retval;
  69. }
  70. inline int ScriptObject::vcpu_getAssignedVariable(int start, int scriptid, int functionId, int *next, int *globalevententry, int *inheritedevent) {
  71. int __retval = _call(SCRIPTOBJECT_VCPU_GETASSIGNEDVARIABLE, (int)0, start, scriptid, functionId, next, globalevententry, inheritedevent);
  72. return __retval;
  73. }
  74. inline void ScriptObject::vcpu_removeAssignedVariable(int var, int id) {
  75. _voidcall(SCRIPTOBJECT_VCPU_REMOVEASSIGNEDVARIABLE, var, id);
  76. }
  77. inline void ScriptObject::vcpu_addAssignedVariable(int var, int scriptid) {
  78. _voidcall(SCRIPTOBJECT_VCPU_ADDASSIGNEDVARIABLE, var, scriptid);
  79. }
  80. inline const wchar_t *ScriptObject::vcpu_getClassName() {
  81. return _call(SCRIPTOBJECT_VCPU_GETCLASSNAME, (const wchar_t *)0);
  82. }
  83. inline ScriptObjectController *ScriptObject::vcpu_getController() {
  84. ScriptObjectController *__retval = _call(SCRIPTOBJECT_VCPU_GETCONTROLLER, (ScriptObjectController *)NULL);
  85. return __retval;
  86. }
  87. inline int ScriptObject::vcpu_getScriptId() {
  88. int __retval = _call(SCRIPTOBJECT_VCPU_GETSCRIPTID, (int)0);
  89. return __retval;
  90. }
  91. inline void ScriptObject::vcpu_setScriptId(int i) {
  92. _voidcall(SCRIPTOBJECT_VCPU_SETSCRIPTID, i);
  93. }
  94. inline int ScriptObject::vcpu_getMember(const wchar_t *id, int scriptid, int rettype) {
  95. int __retval = _call(SCRIPTOBJECT_VCPU_GETMEMBER, (int)0, id, scriptid, rettype);
  96. return __retval;
  97. }
  98. inline void ScriptObject::vcpu_delMembers(int scriptid) {
  99. _voidcall(SCRIPTOBJECT_VCPU_DELMEMBERS, scriptid);
  100. }
  101. inline void ScriptObject::vcpu_setInterface(GUID g, void *v, int interfacetype) {
  102. _voidcall(SCRIPTOBJECT_VCPU_SETINTERFACE, g, v, interfacetype);
  103. }
  104. inline void ScriptObject::vcpu_setClassName(const wchar_t *name) {
  105. _voidcall(SCRIPTOBJECT_VCPU_SETCLASSNAME, name);
  106. }
  107. inline void ScriptObject::vcpu_setController(ScriptObjectController *c) {
  108. _voidcall(SCRIPTOBJECT_VCPU_SETCONTROLLER, c);
  109. }
  110. inline void ScriptObject::vcpu_init() {
  111. _voidcall(SCRIPTOBJECT_VCPU_INIT);
  112. }
  113. // ----------------------------------------------------------------------------
  114. #endif // __SCRIPTOBJECT_H