sapplication.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include <api/script/api_maki.h>
  3. #include <api/script/script.h>
  4. #include <api/script/objcontroller.h>
  5. #include <api/script/objects/rootobj.h>
  6. #include <api/script/objects/rootobject.h>
  7. #define SApplication_SCRIPTPARENT RootObjectInstance
  8. class ApplicationScriptObjectController : public ScriptObjectControllerI
  9. {
  10. public:
  11. virtual const wchar_t *getClassName();
  12. virtual const wchar_t *getAncestorClassName();
  13. virtual ScriptObjectController *getAncestorController();
  14. virtual int getNumFunctions();
  15. virtual const function_descriptor_struct *getExportedFunctions();
  16. virtual GUID getClassGuid();
  17. virtual ScriptObject *instantiate();
  18. virtual int getInstantiable();
  19. virtual int getReferenceable() {return 0;}
  20. virtual void destroy(ScriptObject *o);
  21. virtual void *encapsulate(ScriptObject *o);
  22. virtual void deencapsulate(void *o);
  23. private:
  24. static function_descriptor_struct exportedFunction[];
  25. };
  26. extern ScriptObjectController *applicationController;
  27. class SApplication : public SApplication_SCRIPTPARENT
  28. {
  29. public:
  30. SApplication();
  31. virtual ~SApplication();
  32. public:
  33. static scriptVar GetApplicationName(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  34. static scriptVar GetVersionString(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  35. static scriptVar GetVersionNumberString(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  36. static scriptVar GetBuildNumber(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  37. static scriptVar GetGUID(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  38. static scriptVar GetCommandLine(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  39. static scriptVar Shutdown(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  40. static scriptVar CancelShutdown(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  41. static scriptVar IsShuttingDown(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  42. static scriptVar GetApplicationPath(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  43. static scriptVar GetSettingsPath(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  44. static scriptVar GetWorkingPath(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  45. static scriptVar SetWorkingPath(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar string_path);
  46. static scriptVar GetMachineGUID(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  47. static scriptVar GetUserGUID(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  48. static scriptVar GetSessionGUID(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  49. };