svccbi.h 925 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef NULLSOFT_WASABI_SVCCBI_H
  2. #define NULLSOFT_WASABI_SVCCBI_H
  3. #include "syscbi.h"
  4. #include "svccb.h"
  5. class waServiceFactory;
  6. #define SVCCALLBACK_PARENT SysCallbackI
  7. class SvcCallbackI : public SVCCALLBACK_PARENT {
  8. protected:
  9. SvcCallbackI() { }
  10. public:
  11. virtual void svccb_onSvcRegister(FOURCC type, waServiceFactory *svc) { }
  12. virtual void svccb_onSvcDeregister(FOURCC type, waServiceFactory *svc) { }
  13. private:
  14. virtual FOURCC syscb_getEventType() { return SysCallback::SERVICE; }
  15. virtual int syscb_notify(int msg, intptr_t param1, intptr_t param2) {
  16. switch (msg) {
  17. case SvcCallback::ONREGISTER:
  18. svccb_onSvcRegister((FOURCC)param1, reinterpret_cast<waServiceFactory*>(param1));
  19. break;
  20. case SvcCallback::ONDEREGISTER:
  21. svccb_onSvcRegister((FOURCC)param1, reinterpret_cast<waServiceFactory*>(param1));
  22. break;
  23. default: return 0;
  24. }
  25. return 1;
  26. }
  27. };
  28. #endif