api_servicei.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #include <precomp.h>
  2. #ifndef NOSVCMGR
  3. //<?#include "<class data="implementationheader"/>"
  4. #include "api_servicei.h"
  5. //?>
  6. #include <api/api.h>
  7. #include <api/service/svcmgr.h>
  8. api_service *serviceApi = NULL;
  9. api_serviceI::api_serviceI() {
  10. }
  11. api_serviceI::~api_serviceI() {
  12. ServiceManager::onShutdown();
  13. }
  14. int api_serviceI::service_register(waServiceFactory *svc) {
  15. #ifdef WASABI_COMPILE_COMPONENTS
  16. int r = ServiceManager::registerService(svc, WASABI_API_COMPONENT->getThisGuid());
  17. #else
  18. int r = ServiceManager::registerService(svc, WASABI_API_APP->main_getGUID());
  19. #endif
  20. return r;
  21. }
  22. int api_serviceI::service_deregister(waServiceFactory *svc) {
  23. int r = ServiceManager::deregisterService(svc);
  24. return r;
  25. }
  26. int api_serviceI::service_getNumServices(FOURCC svc_type) {
  27. return ServiceManager::getNumServices(svc_type);
  28. }
  29. waServiceFactory *api_serviceI::service_enumService(FOURCC svc_type, int n) {
  30. return ServiceManager::enumService(svc_type, n);
  31. }
  32. waServiceFactory *api_serviceI::service_getServiceByGuid(GUID guid) {
  33. return ServiceManager::getServiceByGuid(guid);
  34. }
  35. int api_serviceI::service_lock(waServiceFactory *owner, void *svcptr) {
  36. return ServiceManager::lock(owner, svcptr);
  37. }
  38. int api_serviceI::service_clientLock(void *svcptr) {
  39. #ifdef WASABI_COMPILE_COMPONENTS
  40. return ServiceManager::clientLock(svcptr, WASABI_API_COMPONENT->getThisGuid());
  41. #else
  42. return ServiceManager::clientLock(svcptr, WASABI_API_APP->main_getGUID());
  43. #endif
  44. }
  45. int api_serviceI::service_release(void *svcptr) {
  46. return ServiceManager::release(svcptr);
  47. }
  48. const char *api_serviceI::service_getTypeName(FOURCC svc_type) {
  49. return ServiceManager::getServiceTypeName(svc_type);
  50. }
  51. #ifdef WASABI_COMPILE_COMPONENTS
  52. GUID api_serviceI::service_getOwningComponent(void *svcptr) {
  53. return ServiceManager::getOwningComponent(svcptr);
  54. }
  55. GUID api_serviceI::service_getLockingComponent(void *svcptr) {
  56. return ServiceManager::getLockingComponent(svcptr);
  57. }
  58. #endif
  59. int api_serviceI::service_unlock(void *svcptr) {
  60. return ServiceManager::unlock(svcptr);
  61. }
  62. int api_serviceI::service_isvalid(FOURCC svctype, waServiceFactory *service) {
  63. return ServiceManager::isValidService(svctype, service);
  64. }
  65. #endif