factory_png.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "api__png.h"
  2. #include "factory_png.h"
  3. #include "PNGLoader.h"
  4. FOURCC PNGFactory::GetServiceType()
  5. {
  6. return PNGLoader::getServiceType();
  7. }
  8. const char *PNGFactory::GetServiceName()
  9. {
  10. return PNGLoader::getServiceName();
  11. }
  12. // {5E04FB28-53F5-4032-BD29-032B87EC3725}
  13. static const GUID pngGUID =
  14. { 0x5e04fb28, 0x53f5, 0x4032, { 0xbd, 0x29, 0x3, 0x2b, 0x87, 0xec, 0x37, 0x25 } };
  15. GUID PNGFactory::GetGUID()
  16. {
  17. return pngGUID;
  18. }
  19. void *PNGFactory::GetInterface(int global_lock)
  20. {
  21. svc_imageLoader *ifc=new PNGLoader;
  22. // if (global_lock)
  23. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  24. return ifc;
  25. }
  26. int PNGFactory::SupportNonLockingInterface()
  27. {
  28. return 1;
  29. }
  30. int PNGFactory::ReleaseInterface(void *ifc)
  31. {
  32. //WASABI_API_SVC->service_unlock(ifc);
  33. svc_imageLoader *png = static_cast<svc_imageLoader *>(ifc);
  34. PNGLoader *pngloader = static_cast<PNGLoader *>(png);
  35. delete pngloader;
  36. return 1;
  37. }
  38. const char *PNGFactory::GetTestString()
  39. {
  40. return 0;
  41. }
  42. int PNGFactory::ServiceNotify(int msg, int param1, int param2)
  43. {
  44. return 1;
  45. }
  46. #ifdef CBCLASS
  47. #undef CBCLASS
  48. #endif
  49. #define CBCLASS PNGFactory
  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;