1
0

ifc_wasabihelper.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. #ifndef NULLSOFT_WINAMP_WASABI_HELPER_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_WASABI_HELPER_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. class api_service;
  7. #include <bfc/dispatch.h>
  8. #include <api/application/api_application.h>
  9. #include "../Agave/Config/api_config.h"
  10. #include "../Agave/Language/api_language.h"
  11. #include <api/memmgr/api_memmgr.h>
  12. #include <api/service/svcs/svc_imgload.h>
  13. #include "../Winamp/JSAPI2_api_security.h"
  14. #include "../Components/wac_downloadManager/wac_downloadManager_api.h"
  15. #include "../nu/threadpool/api_threadpool.h"
  16. // {CA8954C8-C15F-4a62-A592-86A9464DE9A5}
  17. static const GUID IFC_WasabiHelper =
  18. { 0xca8954c8, 0xc15f, 0x4a62, { 0xa5, 0x92, 0x86, 0xa9, 0x46, 0x4d, 0xe9, 0xa5 } };
  19. class __declspec(novtable) ifc_wasabihelper : public Dispatchable
  20. {
  21. protected:
  22. ifc_wasabihelper() {}
  23. ~ifc_wasabihelper() {}
  24. public:
  25. HRESULT QueryWasabiInterface(const GUID *iid, void **ppi);
  26. HRESULT ReleaseWasabiInterface(const GUID *iid, void *pi);
  27. HRESULT GetServiceManager(api_service **serviceManager);
  28. HRESULT GetApplicationApi(api_application **application);
  29. HRESULT GetConfigApi(api_config ** config);
  30. HRESULT GetMemoryManager(api_memmgr **memoryManager);
  31. HRESULT GetPngLoader(svc_imageLoader **pngLoader);
  32. HRESULT GetLanguageManager(api_language **languageManager);
  33. HRESULT GetLanguageModule(HINSTANCE *module);
  34. HRESULT GetSecurityApi(JSAPI2::api_security **security);
  35. HRESULT GetDownloadManager(api_downloadManager **downloadManager);
  36. HRESULT GetThreadpoolApi(api_threadpool **threadpool);
  37. public:
  38. DISPATCH_CODES
  39. {
  40. API_QUERYWASABIINTERFACE = 10,
  41. API_RELEASEWASABIINTERFACE = 20,
  42. API_GETSERVICEMANAGER = 30,
  43. API_GETAPPLICATION = 40,
  44. API_GETCONFIG = 50,
  45. API_GETMEMORYMANAGER = 60,
  46. API_GETPNGLOADER = 70,
  47. API_GETLANGUAGEMANAGER = 80,
  48. API_GETLANGUAGEMODULE = 90,
  49. API_GETSECURITY = 100,
  50. API_GETDOWNLOADMANAGER = 110,
  51. API_GETTHREADPOOL = 120,
  52. };
  53. };
  54. inline HRESULT ifc_wasabihelper::QueryWasabiInterface(const GUID *iid, void **ppi)
  55. {
  56. return _call(API_QUERYWASABIINTERFACE, (HRESULT)E_NOTIMPL, iid, ppi);
  57. }
  58. inline HRESULT ifc_wasabihelper::ReleaseWasabiInterface(const GUID *iid, void *pi)
  59. {
  60. return _call(API_RELEASEWASABIINTERFACE, (HRESULT)E_NOTIMPL, iid, pi);
  61. }
  62. inline HRESULT ifc_wasabihelper::GetServiceManager(api_service **serviceManager)
  63. {
  64. return _call(API_GETSERVICEMANAGER, (HRESULT)E_NOTIMPL, serviceManager);
  65. }
  66. inline HRESULT ifc_wasabihelper::GetApplicationApi(api_application **application)
  67. {
  68. return _call(API_GETAPPLICATION, (HRESULT)E_NOTIMPL, application);
  69. }
  70. inline HRESULT ifc_wasabihelper::GetConfigApi(api_config ** config)
  71. {
  72. return _call(API_GETCONFIG, (HRESULT)E_NOTIMPL, config);
  73. }
  74. inline HRESULT ifc_wasabihelper::GetMemoryManager(api_memmgr **memoryManager)
  75. {
  76. return _call(API_GETMEMORYMANAGER, (HRESULT)E_NOTIMPL, memoryManager);
  77. }
  78. inline HRESULT ifc_wasabihelper::GetPngLoader(svc_imageLoader **pngLoader)
  79. {
  80. return _call(API_GETPNGLOADER, (HRESULT)E_NOTIMPL, pngLoader);
  81. }
  82. inline HRESULT ifc_wasabihelper::GetLanguageManager(api_language **languageManager)
  83. {
  84. return _call(API_GETLANGUAGEMANAGER, (HRESULT)E_NOTIMPL, languageManager);
  85. }
  86. inline HRESULT ifc_wasabihelper::GetLanguageModule(HINSTANCE *module)
  87. {
  88. return _call(API_GETLANGUAGEMODULE, (HRESULT)E_NOTIMPL, module);
  89. }
  90. inline HRESULT ifc_wasabihelper::GetSecurityApi(JSAPI2::api_security **security)
  91. {
  92. return _call(API_GETSECURITY, (HRESULT)E_NOTIMPL, security);
  93. }
  94. inline HRESULT ifc_wasabihelper::GetDownloadManager(api_downloadManager **downloadManager)
  95. {
  96. return _call(API_GETDOWNLOADMANAGER, (HRESULT)E_NOTIMPL, downloadManager);
  97. }
  98. inline HRESULT ifc_wasabihelper::GetThreadpoolApi(api_threadpool **threadpool)
  99. {
  100. return _call(API_GETTHREADPOOL, (HRESULT)E_NOTIMPL, threadpool);
  101. }
  102. #endif // NULLSOFT_WINAMP_WASABI_HELPER_INTERFACE_HEADER