diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/service/ifc_servicefactory.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/service/ifc_servicefactory.h')
-rw-r--r-- | Src/replicant/service/ifc_servicefactory.h | 44 |
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; +}; |