1
0

ScriptFactory.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include "ScriptFactory.h"
  2. #include "api.h"
  3. #include "ScriptObjectService.h"
  4. static ScriptObjectService svc;
  5. static const char serviceName[] = "Timer Maki Object";
  6. // GUID of our service factory, not the GUID of the maki object
  7. // {538A1D71-74B0-4fbf-877A-241D10A937F3}
  8. static const GUID timer_maki_guid =
  9. { 0x538a1d71, 0x74b0, 0x4fbf, { 0x87, 0x7a, 0x24, 0x1d, 0x10, 0xa9, 0x37, 0xf3 } };
  10. FOURCC ScriptFactory::GetServiceType()
  11. {
  12. return svc.getServiceType();
  13. }
  14. const char *ScriptFactory::GetServiceName()
  15. {
  16. return serviceName;
  17. }
  18. GUID ScriptFactory::GetGUID()
  19. {
  20. return timer_maki_guid;
  21. }
  22. void *ScriptFactory::GetInterface(int global_lock)
  23. {
  24. // if (global_lock)
  25. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  26. return &svc;
  27. }
  28. int ScriptFactory::SupportNonLockingInterface()
  29. {
  30. return 1;
  31. }
  32. int ScriptFactory::ReleaseInterface(void *ifc)
  33. {
  34. //WASABI_API_SVC->service_unlock(ifc);
  35. return 1;
  36. }
  37. const char *ScriptFactory::GetTestString()
  38. {
  39. return 0;
  40. }
  41. int ScriptFactory::ServiceNotify(int msg, int param1, int param2)
  42. {
  43. return 1;
  44. }
  45. #define CBCLASS ScriptFactory
  46. START_DISPATCH;
  47. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  48. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  49. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  50. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  51. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  52. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  53. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  54. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  55. END_DISPATCH;
  56. #undef CBCLASS