NSProcessInfo.inc 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. { Parsed from Foundation.framework NSProcessInfo.h }
  2. {$ifdef TYPES}
  3. type
  4. NSProcessInfoPtr = ^NSProcessInfo;
  5. {$endif}
  6. {$ifdef TYPES}
  7. const
  8. NSWindowsNTOperatingSystem = 1;
  9. NSWindows95OperatingSystem = 2;
  10. NSSolarisOperatingSystem = 3;
  11. NSHPUXOperatingSystem = 4;
  12. NSMACHOperatingSystem = 5;
  13. NSSunOSOperatingSystem = 6;
  14. NSOSF1OperatingSystem = 7;
  15. type
  16. NSOperatingSystemVersion = record
  17. majorVersion: NSInteger;
  18. minorVersion: NSInteger;
  19. patchVersion: NSInteger;
  20. end;
  21. type
  22. NSOperatingSystemVersionPtr = ^NSOperatingSystemVersion;
  23. {$endif}
  24. {$ifdef CLASSES}
  25. type
  26. NSProcessInfo = objcclass external (NSObject)
  27. private
  28. environment_: NSDictionary;
  29. arguments_: NSArray;
  30. hostName_: NSString;
  31. name: NSString;
  32. automaticTerminationOptOutCounter: NSInteger;
  33. public
  34. class function processInfo: NSProcessInfo; message 'processInfo';
  35. function environment: NSDictionary; message 'environment';
  36. function arguments: NSArray; message 'arguments';
  37. function hostName: NSString; message 'hostName';
  38. procedure setProcessName(newValue: NSString); message 'setProcessName:';
  39. function processName: NSString; message 'processName';
  40. function processIdentifier: cint; message 'processIdentifier';
  41. function globallyUniqueString: NSString; message 'globallyUniqueString';
  42. function operatingSystem: NSUInteger; message 'operatingSystem'; deprecated 'in 10_0, 10_10, 2_0, 8_0, "-operatingSystem always returns NSMACHOperatingSystem, use -operatingSystemVersion or -isOperatingSystemAtLeastVersion: instead"';
  43. function operatingSystemName: NSString; message 'operatingSystemName'; deprecated 'in 10_0, 10_10, 2_0, 8_0, "-operatingSystemName always returns NSMACHOperatingSystem, use -operatingSystemVersionString instead"';
  44. function operatingSystemVersionString: NSString; message 'operatingSystemVersionString';
  45. function operatingSystemVersion: NSOperatingSystemVersion; message 'operatingSystemVersion';
  46. function processorCount: NSUInteger; message 'processorCount';
  47. function activeProcessorCount: NSUInteger; message 'activeProcessorCount';
  48. function physicalMemory: culonglong; message 'physicalMemory';
  49. function isOperatingSystemAtLeastVersion (version: NSOperatingSystemVersion): ObjCBOOL; message 'isOperatingSystemAtLeastVersion:'; { available in 10_10, 8_0 }
  50. function systemUptime: NSTimeInterval; message 'systemUptime';
  51. procedure disableSuddenTermination; message 'disableSuddenTermination'; { available in 10_6, NA }
  52. procedure enableSuddenTermination; message 'enableSuddenTermination'; { available in 10_6, NA }
  53. procedure disableAutomaticTermination (reason: NSString); message 'disableAutomaticTermination:'; { available in 10_7, NA }
  54. procedure enableAutomaticTermination (reason: NSString); message 'enableAutomaticTermination:'; { available in 10_7, NA }
  55. procedure setAutomaticTerminationSupportEnabled(newValue: ObjCBOOL); message 'setAutomaticTerminationSupportEnabled:';
  56. function automaticTerminationSupportEnabled: ObjCBOOL; message 'automaticTerminationSupportEnabled';
  57. end;
  58. {$endif}
  59. {$ifdef TYPES}
  60. type
  61. NSActivityOptions = cuint64;
  62. NSActivityOptionsPtr = ^NSActivityOptions;
  63. const
  64. NSActivityIdleDisplaySleepDisabled = 1 shl 40;
  65. NSActivityIdleSystemSleepDisabled = 1 shl 20;
  66. NSActivitySuddenTerminationDisabled = 1 shl 14;
  67. NSActivityAutomaticTerminationDisabled = 1 shl 15;
  68. NSActivityUserInitiated = $00FFFFFF + NSActivityIdleSystemSleepDisabled;
  69. NSActivityUserInitiatedAllowingIdleSystemSleep = NSActivityUserInitiated and (not NSActivityIdleSystemSleepDisabled);
  70. NSActivityBackground = $000000FF;
  71. NSActivityLatencyCritical = $FF00000000;
  72. {$endif}
  73. {$ifdef CLASSES}
  74. type
  75. NSProcessInfoActivity = objccategory external (NSProcessInfo)
  76. function beginActivityWithOptions_reason (options: NSActivityOptions; reason: NSString): NSObjectProtocol; message 'beginActivityWithOptions:reason:'; { available in 10_9, 7_0 }
  77. procedure endActivity (activity: NSObjectProtocol); message 'endActivity:'; { available in 10_9, 7_0 }
  78. procedure performActivityWithOptions_reason_usingBlock (options: NSActivityOptions; reason: NSString; block: OpaqueCBlock); message 'performActivityWithOptions:reason:usingBlock:'; { available in 10_9, 7_0 }
  79. end;
  80. {$endif}