1
0

api_syscb.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "foundation/dispatch.h"
  3. #include "foundation/types.h"
  4. #include "service/types.h"
  5. class ifc_sysCallback;
  6. // {57B7A1B6-700E-44ff-9CB0-70B92BAF3959}
  7. static const GUID syscbApiServiceGuid =
  8. { 0x57b7a1b6, 0x700e, 0x44ff, { 0x9c, 0xb0, 0x70, 0xb9, 0x2b, 0xaf, 0x39, 0x59 } };
  9. // ----------------------------------------------------------------------------
  10. class NOVTABLE api_syscb : public Wasabi2::Dispatchable
  11. {
  12. protected:
  13. api_syscb() : Dispatchable(DISPATCHABLE_VERSION) {}
  14. ~api_syscb() {}
  15. public:
  16. static const GUID GetServiceGUID() { return syscbApiServiceGuid; }
  17. static const GUID GetServiceType() { return SVC_TYPE_UNIQUE; }
  18. int RegisterCallback(ifc_sysCallback *cb) { return SysCallbacks_RegisterCallback(cb); }
  19. int UnregisterCallback(ifc_sysCallback *cb) { return SysCallbacks_UnregisterCallback(cb); }
  20. int IssueCallback(GUID eventtype, int msg, intptr_t param1 = 0, intptr_t param2 = 0) { return SysCallbacks_IssueCallback(eventtype, msg, param1, param2); }
  21. /** pass eventtype == 0 to enumerate all syscallbacks
  22. ** call Release() on the returned ifc_sysCallback when you are done
  23. ** although very few wasabi objects support this at this time (2 June 2008)
  24. **/
  25. ifc_sysCallback *syscb_enum(GUID eventtype, size_t n) { return SysCallbacks_Enum(eventtype, n); }
  26. enum
  27. {
  28. DISPATCHABLE_VERSION,
  29. };
  30. protected:
  31. virtual int WASABICALL SysCallbacks_RegisterCallback(ifc_sysCallback *cb)=0;
  32. virtual int WASABICALL SysCallbacks_UnregisterCallback(ifc_sysCallback *cb)=0;
  33. virtual int WASABICALL SysCallbacks_IssueCallback(GUID eventtype, int msg, intptr_t param1 = 0, intptr_t param2 = 0)=0;
  34. /** pass eventtype == 0 to enumerate all syscallbacks
  35. ** call Release() on the returned ifc_sysCallback when you are done
  36. ** although very few wasabi objects support this at this time (2 June 2008)
  37. **/
  38. virtual ifc_sysCallback *WASABICALL SysCallbacks_Enum(GUID eventtype, size_t n)=0;
  39. };