rxdlinkr.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright 2015 Autodesk, Inc. All rights reserved.
  6. //
  7. // Use of this software is subject to the terms of the Autodesk license
  8. // agreement provided at the time of installation or download, or which
  9. // otherwise accompanies this software in either electronic or hard copy form.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #ifndef _rxdlinkr_h
  13. #define _rxdlinkr_h 1
  14. class AcRxDLinkerReactor;
  15. class AcRxService;
  16. #include "rxobject.h"
  17. #include "AdAChar.h"
  18. #pragma pack (push, 8)
  19. struct AcadApp
  20. {
  21. enum LoadReasons {
  22. kOnProxyDetection = 0x01,
  23. kOnAutoCADStartup = 0x02,
  24. kOnCommandInvocation = 0x04,
  25. kOnLoadRequest = 0x08,
  26. kLoadDisabled = 0x10,
  27. kTransparentlyLoadable = 0x20,
  28. kOnIdleLoad = 0x40
  29. };
  30. enum ErrorStatus {
  31. eOk = 0,
  32. eInvalidKey = 1,
  33. eInvalidSubKey = 2,
  34. eKeyNotFound = 3,
  35. eOutOfMemory = 4,
  36. eInvalidValue = 5,
  37. eValueNotFound = 6,
  38. eKeyExists = 7,
  39. eRegAccessDenied= 8,
  40. eRejected = 9,
  41. eUnknownError = 10
  42. };
  43. };
  44. class ADESK_NO_VTABLE AcRxDynamicLinker: public AcRxObject
  45. {
  46. public:
  47. ACRX_DECLARE_MEMBERS(AcRxDynamicLinker);
  48. virtual void* getSymbolAddress (const ACHAR * serviceName,
  49. const char * symbol) const = 0;
  50. #ifdef AD_UNICODE
  51. // Overload it for convenience of callers that want to
  52. // put _T() around all literals.
  53. virtual void* getSymbolAddress (const ACHAR * serviceName,
  54. const ACHAR * symbol) const = 0;
  55. #endif
  56. virtual bool initListedModules(const ACHAR * fileName) = 0;
  57. virtual bool loadModule (const ACHAR * fileName,
  58. bool printit,
  59. bool asCmd=false) = 0;
  60. virtual bool loadApp (const ACHAR * appName,
  61. AcadApp::LoadReasons al,
  62. bool printit,
  63. bool asCmd=false) = 0;
  64. virtual AcRxObject* registerService (const ACHAR * serviceName,
  65. AcRxService* serviceObj) = 0;
  66. virtual bool unloadModule (const ACHAR * fileName,
  67. bool asCmd=false) = 0;
  68. virtual bool unloadApp (const ACHAR * appName,
  69. bool asCmd=false) = 0;
  70. virtual void addReactor (AcRxDLinkerReactor* newReactor) =0;
  71. virtual void removeReactor (AcRxDLinkerReactor* oldReactor) =0;
  72. virtual bool isApplicationLocked(const ACHAR * modulename) const =0;
  73. virtual bool lockApplication (void* appId) const = 0;
  74. virtual bool unlockApplication(void* appId) const = 0;
  75. virtual bool isAppMDIAware(const ACHAR * modulename) const =0;
  76. virtual bool registerAppMDIAware(void* appId) const =0;
  77. virtual bool registerAppNotMDIAware(void* appId) const =0;
  78. virtual bool isAppBusy(const ACHAR * modulename) const =0;
  79. virtual void setAppBusy(const ACHAR * modulename, bool bBusyFlag) const =0;
  80. virtual Adesk::UInt32 ProductLcid() const =0;
  81. };
  82. // The kernel creates the one and only dynamic linker, at
  83. //
  84. #define acrxDynamicLinker \
  85. AcRxDynamicLinker::cast(acrxSysRegistry()->at(ACRX_DYNAMIC_LINKER))
  86. class ADESK_NO_VTABLE AcRxDLinkerReactor: public AcRxObject
  87. //
  88. // Class defining notification events from the dynamic linker,
  89. // specifically the loading and unloading of Arx applications.
  90. //
  91. // Recipients of these calls can and should also
  92. // check the registered services, class and objects to find out
  93. // what happened to logical elements of the system, rather
  94. // than be bound to file name.
  95. //
  96. {
  97. public:
  98. ACRX_DECLARE_MEMBERS(AcRxDLinkerReactor);
  99. virtual void rxAppWillBeLoaded(const ACHAR * moduleName);
  100. virtual void rxAppLoaded(const ACHAR * moduleName);
  101. virtual void rxAppLoadAborted(const ACHAR * moduleName);
  102. virtual void rxAppWillBeUnloaded(const ACHAR * moduleName);
  103. virtual void rxAppUnloaded(const ACHAR * moduleName);
  104. virtual void rxAppUnloadAborted(const ACHAR * moduleName);
  105. };
  106. #pragma pack (pop)
  107. #endif