waservicefactory.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // ----------------------------------------------------------------------------
  2. // Generated by InterfaceFactory [Wed May 07 00:57:16 2003]
  3. //
  4. // File : waservicefactory.h
  5. // Class : waServiceFactory
  6. // class layer : Dispatchable Interface
  7. // ----------------------------------------------------------------------------
  8. #ifndef __WASERVICEFACTORY_H
  9. #define __WASERVICEFACTORY_H
  10. #include <bfc/dispatch.h>
  11. #include <bfc/nsguid.h>
  12. #include "api_service.h"
  13. // ----------------------------------------------------------------------------
  14. class NOVTABLE waServiceFactory : public Dispatchable
  15. {
  16. protected:
  17. waServiceFactory() throw( ) {}
  18. ~waServiceFactory() {}
  19. public:
  20. FOURCC getServiceType();
  21. const char *getServiceName();
  22. GUID getGuid();
  23. const wchar_t *getTestString();
  24. void *getInterface( int global_lock = TRUE );
  25. int releaseInterface( void *ifc );
  26. int supportNonLockingGetInterface();
  27. int serviceNotify( int msg, intptr_t param1 = 0, intptr_t param2 = 0 );
  28. protected:
  29. enum
  30. {
  31. WASERVICEFACTORY_GETSERVICETYPE = 100,
  32. WASERVICEFACTORY_GETSERVICENAME = 200,
  33. WASERVICEFACTORY_GETGUID = 210,
  34. WASERVICEFACTORY_GETINTERFACE = 300,
  35. WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE = 301,
  36. WASERVICEFACTORY_RELEASEINTERFACE = 310,
  37. WASERVICEFACTORY_GETTESTSTRING = 500,
  38. WASERVICEFACTORY_SERVICENOTIFY = 600,
  39. };
  40. };
  41. // ----------------------------------------------------------------------------
  42. inline FOURCC waServiceFactory::getServiceType()
  43. {
  44. FOURCC __retval = _call( WASERVICEFACTORY_GETSERVICETYPE, (FOURCC)NULL );
  45. return __retval;
  46. }
  47. inline const char *waServiceFactory::getServiceName()
  48. {
  49. const char *__retval = _call( WASERVICEFACTORY_GETSERVICENAME, (const char *)0 );
  50. return __retval;
  51. }
  52. inline GUID waServiceFactory::getGuid()
  53. {
  54. GUID __retval = _call( WASERVICEFACTORY_GETGUID, INVALID_GUID );
  55. return __retval;
  56. }
  57. inline const wchar_t *waServiceFactory::getTestString()
  58. {
  59. return _call( WASERVICEFACTORY_GETTESTSTRING, (const wchar_t *)0 );
  60. }
  61. inline void *waServiceFactory::getInterface( int global_lock )
  62. {
  63. void *__retval = _call( WASERVICEFACTORY_GETINTERFACE, (void *)NULL, global_lock );
  64. #if 0 // unused in Winamp 5
  65. // -- generated code - edit in waservicefactoryi.h
  66. // support old code that always locks even when global_lock==FALSE
  67. if ( !global_lock && __retval != NULL && !supportNonLockingGetInterface() )
  68. WASABI_API_SVC->service_unlock( __retval );
  69. #endif
  70. return __retval;
  71. }
  72. inline int waServiceFactory::releaseInterface( void *ifc )
  73. {
  74. int __retval = _call( WASERVICEFACTORY_RELEASEINTERFACE, (int)0, ifc );
  75. return __retval;
  76. }
  77. inline int waServiceFactory::supportNonLockingGetInterface()
  78. {
  79. int __retval = _call( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, (int)0 );
  80. return __retval;
  81. }
  82. inline int waServiceFactory::serviceNotify( int msg, intptr_t param1, intptr_t param2 )
  83. {
  84. int __retval = _call( WASERVICEFACTORY_SERVICENOTIFY, (int)0, msg, param1, param2 );
  85. return __retval;
  86. }
  87. // ----------------------------------------------------------------------------
  88. #endif // __WASERVICEFACTORY_H