aboutsummaryrefslogtreecommitdiff
path: root/Src/filereader/ResourceReaderFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Src/filereader/ResourceReaderFactory.cpp')
-rw-r--r--Src/filereader/ResourceReaderFactory.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/Src/filereader/ResourceReaderFactory.cpp b/Src/filereader/ResourceReaderFactory.cpp
new file mode 100644
index 00000000..ca76c740
--- /dev/null
+++ b/Src/filereader/ResourceReaderFactory.cpp
@@ -0,0 +1,75 @@
+#include "api__filereader.h"
+#include "ResourceReaderFactory.h"
+#include "ResourceReader.h"
+
+static const char serviceName[] = "Resource reader";
+
+// {C975969A-5DFD-4f2b-B767-4EDC6C7D6484}
+static const GUID ResourceReaderGUID =
+{ 0xc975969a, 0x5dfd, 0x4f2b, { 0xb7, 0x67, 0x4e, 0xdc, 0x6c, 0x7d, 0x64, 0x84 } };
+
+
+FOURCC ResourceReaderFactory::GetServiceType()
+{
+ return WaSvc::FILEREADER;
+}
+
+const char *ResourceReaderFactory::GetServiceName()
+{
+ return serviceName;
+}
+
+GUID ResourceReaderFactory::GetGUID()
+{
+ return ResourceReaderGUID;
+}
+
+void *ResourceReaderFactory::GetInterface( int global_lock )
+{
+ ResourceReader *ifc = new ResourceReader;
+
+ if ( global_lock )
+ WASABI_API_SVC->service_lock( this, (void *)ifc );
+
+ return ifc;
+}
+
+int ResourceReaderFactory::SupportNonLockingInterface()
+{
+ return 1;
+}
+
+int ResourceReaderFactory::ReleaseInterface(void *ifc)
+{
+ //WASABI_API_SVC->service_unlock(ifc);
+ svc_fileReader *reader = static_cast<svc_fileReader *>(ifc);
+ ResourceReader *resourceReader = static_cast<ResourceReader *>(reader);
+ delete resourceReader;
+ return 1;
+}
+
+const char *ResourceReaderFactory::GetTestString()
+{
+ return 0;
+}
+
+int ResourceReaderFactory::ServiceNotify(int msg, int param1, int param2)
+{
+ return 1;
+}
+
+#ifdef CBCLASS
+#undef CBCLASS
+#endif
+
+#define CBCLASS ResourceReaderFactory
+START_DISPATCH;
+CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
+CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
+CB(WASERVICEFACTORY_GETGUID, GetGUID)
+CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
+CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
+CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
+CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
+CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
+END_DISPATCH;