1
0

factory_pngwrite.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "api__png.h"
  2. #include "factory_pngwrite.h"
  3. #include "PNGWriter.h"
  4. FOURCC PNGWriteFactory::GetServiceType()
  5. {
  6. return PNGWriter::getServiceType();
  7. }
  8. const char *PNGWriteFactory::GetServiceName()
  9. {
  10. return PNGWriter::getServiceName();
  11. }
  12. // {D089F671-283E-4999-A5C8-FE3DD851F3F1}
  13. static const GUID pngWriteGUID =
  14. { 0xd089f671, 0x283e, 0x4999, { 0xa5, 0xc8, 0xfe, 0x3d, 0xd8, 0x51, 0xf3, 0xf1 } };
  15. GUID PNGWriteFactory::GetGUID()
  16. {
  17. return pngWriteGUID;
  18. }
  19. void *PNGWriteFactory::GetInterface(int global_lock)
  20. {
  21. svc_imageWriter *ifc=new PNGWriter;
  22. // if (global_lock)
  23. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  24. return ifc;
  25. }
  26. int PNGWriteFactory::SupportNonLockingInterface()
  27. {
  28. return 1;
  29. }
  30. int PNGWriteFactory::ReleaseInterface(void *ifc)
  31. {
  32. //WASABI_API_SVC->service_unlock(ifc);
  33. svc_imageWriter *png = static_cast<svc_imageWriter *>(ifc);
  34. PNGWriter *pngWriter = static_cast<PNGWriter *>(png);
  35. delete pngWriter;
  36. return 1;
  37. }
  38. const char *PNGWriteFactory::GetTestString()
  39. {
  40. return 0;
  41. }
  42. int PNGWriteFactory::ServiceNotify(int msg, int param1, int param2)
  43. {
  44. return 1;
  45. }
  46. #ifdef CBCLASS
  47. #undef CBCLASS
  48. #endif
  49. #define CBCLASS PNGWriteFactory
  50. START_DISPATCH;
  51. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  52. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  53. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  54. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  55. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  56. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  57. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  58. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  59. END_DISPATCH;