browserFactory.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include "./browserFactory.h"
  2. #include "./browserObject.h"
  3. FOURCC OmBrowserFactory::GetServiceType()
  4. {
  5. return WaSvc::UNIQUE;
  6. }
  7. const char *OmBrowserFactory::GetServiceName()
  8. {
  9. return "OmBrowser Object";
  10. }
  11. const char *OmBrowserFactory::GetTestString()
  12. {
  13. return NULL;
  14. }
  15. GUID OmBrowserFactory::GetGUID()
  16. {
  17. return OBJ_OmBrowser;
  18. }
  19. void *OmBrowserFactory::GetInterface( int global_lock )
  20. {
  21. OmBrowserObject *browserObject = NULL;
  22. HRESULT hr = OmBrowserObject::CreateInstance( &browserObject );
  23. if ( FAILED( hr ) )
  24. browserObject = NULL;
  25. return browserObject;
  26. }
  27. int OmBrowserFactory::ReleaseInterface( void *ifc )
  28. {
  29. obj_ombrowser *object = (obj_ombrowser *)ifc;
  30. if ( object != NULL )
  31. object->Release();
  32. return 1;
  33. }
  34. int OmBrowserFactory::SupportNonLockingInterface()
  35. {
  36. return 1;
  37. }
  38. int OmBrowserFactory::ServiceNotify(int msg, int param1, int param2)
  39. {
  40. return 1;
  41. }
  42. HRESULT OmBrowserFactory::Register( api_service *service )
  43. {
  44. if ( service == NULL )
  45. return E_INVALIDARG;
  46. service->service_register( this );
  47. return S_OK;
  48. }
  49. HRESULT OmBrowserFactory::Unregister( api_service *service )
  50. {
  51. if ( service == NULL )
  52. return E_INVALIDARG;
  53. service->service_deregister( this );
  54. return S_OK;
  55. }
  56. #define CBCLASS OmBrowserFactory
  57. START_DISPATCH;
  58. CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
  59. CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
  60. CB( WASERVICEFACTORY_GETGUID, GetGUID )
  61. CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
  62. CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
  63. CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
  64. CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
  65. CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
  66. END_DISPATCH;
  67. #undef CBCLASS