aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/service/ifc_servicefactory.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/replicant/service/ifc_servicefactory.h')
-rw-r--r--Src/replicant/service/ifc_servicefactory.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Src/replicant/service/ifc_servicefactory.h b/Src/replicant/service/ifc_servicefactory.h
new file mode 100644
index 00000000..fa97665d
--- /dev/null
+++ b/Src/replicant/service/ifc_servicefactory.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "../foundation/dispatch.h"
+#include "../foundation/guid.h"
+#include "../nx/nxstring.h"
+
+// ----------------------------------------------------------------------------
+
+class NOVTABLE ifc_serviceFactory : public Wasabi2::Dispatchable
+{
+protected:
+ ifc_serviceFactory() : Dispatchable(DISPATCHABLE_VERSION) {}
+ ~ifc_serviceFactory() {}
+
+
+public:
+ GUID GetServiceType() { return ServiceFactory_GetServiceType(); }
+ nx_string_t GetServiceName() { return ServiceFactory_GetServiceName(); }
+ GUID GetGUID() { return ServiceFactory_GetGUID(); }
+ void *GetInterface() { return ServiceFactory_GetInterface(); }
+ int ServiceNotify(int msg, intptr_t param1 = 0, intptr_t param2 = 0) { return ServiceFactory_ServiceNotify(msg, param1, param2); }
+
+ // serviceNotify enums
+ enum
+ {
+ ONREGISTERED=0, // init yourself here -- not all other services are registered yet
+ ONSTARTUP=1, // everyone is initialized, safe to talk to other services
+ ONAPPRUNNING=2, // app is showing and processing events
+ ONBEFORESHUTDOWN=3, // system is about to shutdown, call WASABI2_API_APP->main_cancelShutdown() to cancel
+ ONSHUTDOWN=4, // studio is shutting down, release resources from other services
+ ONUNREGISTERED=5, // bye bye
+ };
+
+ enum
+ {
+ DISPATCHABLE_VERSION,
+ };
+protected:
+ virtual GUID WASABICALL ServiceFactory_GetServiceType()=0;
+ virtual nx_string_t WASABICALL ServiceFactory_GetServiceName()=0;
+ virtual GUID WASABICALL ServiceFactory_GetGUID()=0;
+ virtual void *WASABICALL ServiceFactory_GetInterface()=0;
+ virtual int WASABICALL ServiceFactory_ServiceNotify(int msg, intptr_t param1 = 0, intptr_t param2 = 0)=0;
+};